CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Unable to retrieve array on record form

Print topic Send  topic

Author Message
aldrin151

Posts: 11
Posted: 11/13/2008, 1:17 PM

Hi everyone, I'm new in cc studio and I'm not able to get array values and insert them into a field in a table from a record form...I'm using a record form with templates. When I go ahead and try to add the record I get a, Warning: Invalid argument supplied for foreach(). I have tried this with a php file I made outside of codecharge using $color_array = $_POST['color']; to retrieve from the post but can't get it to work in codecharge. I also tried

$color_array = CCGetFromGet("color");
$color_array = CCGetFromPost("color");


//Html inside template

<input id="Checkbox1" type="checkbox" value="Blue" name="color[]">
<input id="Checkbox2" type="checkbox" value="Green" name="color[]">

// Custom code in Before Insert


$color_array = $colorpost->color->Value;
foreach ($color_array as $per_color) {
$source .= $per_color.",";
}
$color = substr($source, 0, -1);

$colorpost->color->SetValue($color);

Thanks...
View profile  Send private message
headhunter


Posts: 130
Posted: 11/13/2008, 1:32 PM

What is this:
$colorpost->color->Value
??
must this not be
$colorpost->color->GetValue()
View profile  Send private message
aldrin151

Posts: 11
Posted: 11/13/2008, 1:47 PM

Actually I tested

$color = "Green";

$colorpost->color->SetValue($color);

and it works fine...just can't get the array
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.