Forum Moderators: coopster
I find that when I submit a form with no radio button selected in a particular group, neither the radio button group's key nor its value (null) is sent to the script I'm submitting it to.
I was going to just say
if(!isset($_POST[$key]) ) {
$_POST[$key] = "No Response";
}
but that doesn't work when the $key isn't even set.
how can I deal with it?
$radio_column_array = array("field4", "field5", "field6", "field9");
$update = "UPDATE mytable SET ";
$q = "SHOW COLUMNS FROM mytable";
$result = mysql_query($q);
foreach ($radio_column_array as $col_name)
{
$update .= (isset($_POST[$col_name]))
? $colname . '=`' . $_POST[$col_name] . '`,'
: $colname . '=`No Response`,'
}
substr($update, 0, -1); // to strip off the last comma
$update .= " WHERE id=$id";
Something like that might work for you.
Tom