I've been working this code like in 4 hours just to look for the error. My problem is I can't get the selected values. It refresh and display the selected 'Select One' in options.
echo "<label for='device'> Select Device </label>";
echo "<select name='device_name' onchange=\"reload(this.form)\"><option value=''>Select one</option>";
//echo "<option value=''>Select one</option>";
if (is_array($list))
{
foreach ($list as $dname)
{
$dev_code = $dname[0];
$dev_name = $dname[1];
if ($dev_code == @$dev)
{
echo "<option selected value ='$dev_code'>$dev_name</option>";
}
else
{
echo "<option value='$dev_code'>$dev_name</option>";
}
}
}
echo "</select><br/>";
Any help is greatly appreciated. Thank you.