I think that works for most input types for dropdown forms I have the combination of two different pieces of code.
<SELECT NAME="status" SIZE="1">
<OPTION <?php s($v,1)?>VALUE="1">ACTIVE</OPTION>
<OPTION <?php s($v,2)?>VALUE="2">BROKEN</OPTION>
<OPTION <?php s($v,3)?>VALUE="3">PLANNED</OPTION>
<OPTION <?php s($v,4)?>VALUE="4">REMOVE</OPTION>
</SELECT>
function s($v,$i)
{
if($v[status]==$i)
{echo("SELECTED ");
}
}
So what it does is output default into the html if that value is selected, and if that value is not selected it does nothing. And in a dropdown if you put selected into one of the options it defaults to that option.