Guys I have a dropdown list which, when i press the button, i want to mark the selected row automatically! my code so far is shown below, but i cant get it work... with ' " etc.
echo "<select id='form' name=form style='width:auto' class='form-control'>
<optgroup label='form_name'>";
foreach($results as $result)
{
$ID = $result->ID;
$name = $result->name;
$address = $result->address;
echo '<option value=$ID '.
**if(isset($_GET['form']) && $_GET['form'] == $ID ){ .' selected="selected" '. } else { .''. }**
.'>'.$ID. ". " .$name. " [" .$address.']</option>';
}
echo "</optgroup>
</select>;
thanks in advance!!!
"<option value=$ID ""<select id='form' name=form style='width:auto'you have to put name in quotation marks