Hi,
I have currently a drop down box on my form which I don't need as there is only one option, how do I alter the code so that the only option is selected and the values for it are returned.
The initial Code:
I have changed it to this, but it doesn't return the value of the default selected option. It doesn't need to be be a drop down box as there is one option only.
I have currently a drop down box on my form which I don't need as there is only one option, how do I alter the code so that the only option is selected and the values for it are returned.
The initial Code:
PHP:
<form name="program" method="POST">
<td width="100%" align="right"height="40" colspan="3" ><b>ID</b>
<select name="programs" onChange="document.program.submit()"><option value="All" ><?=$lhome_AllPrograms?></option>
<? while($row=mysql_fetch_object($result))
{
if($programs=="$row->program_id")
$programName="selected";
else
$programName="";
?>
<option <?=$programName?> value="<?=$row->program_id?>"> PGM=<?=$row->program_id?>ย <?=stripslashes($row->program_url)?> </option>
<?
}
?>
</select>
</td>
</form>
I have changed it to this, but it doesn't return the value of the default selected option. It doesn't need to be be a drop down box as there is one option only.
PHP:
<form name="program" method="POST">
<td width="100%" align="right"height="40" colspan="3" ><b>ID</b>
<select name="programs" onChange="document.program.submit()">
<? while($row=mysql_fetch_object($result))
{
if($programs=="$row->program_id")
$programName="selected";
else
$programName="";
?>
<option <?=$programName?> value="<?=$row->program_id?>"> PGM=<?=$row->program_id?>ย <?=stripslashes($row->program_url)?> </option> <?
}
?>
</select>
</td>
</form>








