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...
|
 |
 |
headhunter
Posts: 130
|
| Posted: 11/13/2008, 1:32 PM |
|
What is this: $colorpost->color->Value ??
must this not be $colorpost->color->GetValue()
|
 |
 |
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
|
 |
 |
|