(02-12-2015, 06:46 AM)BrandenM Wrote: when I try to clear the form, the repopulated option acts as the selectedIndex ( as it should ) and I can't reset the input to the top option.
I think I had a problem similar to that, and I solved it this way.
PHP Code:
<select name="gift_list]">
<option value="0" <?= set_select('gift_list', '0') ?>>Select...</option>
Basically, I treated the top option as a valid selection with value zero. If the user doesn't make a different selection (one that has a non-zero value), I can catch that during validation.
Hey, don't work without a PHP debugger. Several free IDEs have this features built in. Two are NetBeans and CodeLobster. Without a debugger, it's like you're driving with a blindfold on -- you are going to crash!