Jump to content

Drop Down Box Help


Ell20

Recommended Posts

Hi,

 

I have a couple of drop down boxes which you select the option you want, that value is then stored in the database.

If you make a mistake there is an edit option which once clicked shows the form with the information filled in/selected.

 

However my problem is that when you edit, although the current option which was previously entered into the drop down box is set as the starting value, which is disabled, if you dont change the drop down box the value is deleted rather than held as it hasnt changed.

 

I hope this makes sense, but here is some snippets of the code to try and explain what im talking about:

 

Drop down box code:
<select name="by2"><option value='' selected disabled>
<?php if(isset($wr)) {?> 
<?=$wr?> 
<?php } 
if ($wr == "") { 
echo 'Wickets/Runs';
}
?>
</option>
<option value="Wickets">Wickets</option>
<option value="Runs">Runs</option>

 

Thanks for your help

Link to comment
https://forums.phpfreaks.com/topic/79269-drop-down-box-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.