php - Form built from database array values is not limiting radio buttons to single selection -
i trying build form user selects item based upon array of values database table. here code using filter out list:
$arrlength=count($results); $listsubscriptions = '<form>'; for($x=0; $x<$arrlength; $x++) { $itemlist = $results[$x]->item_name; $listsubscriptions .= '<input type="radio" name="'.$itemlist.'" value="'.$itemlist.'"> '.$itemlist.'<br>'; } $listsubscriptions .= '</form>'; return $listsubscriptions;
when print results of form able radio buttons display them to, problem selection not being limited 1 radio button selection. ideas why?
the radio buttons must share single name
attribute belong same group:
$listsubscriptions .= '<input type="radio" name="subscription" value="' . $itemlist . '"> ' . $itemlist . '<br>';
Comments
Post a Comment