I have a problem on a form. The form allows users to select one of two options (A or B) from a drop down menu and the code echos the selection (to load different fields on a subsequent form). That works fine.
The problem is, there is an input in the subsequent form which can be used in both selections (Input X) and the code is set to remember the user inputs if the user wants to go back and forth and edit the form. That works fine until the user decides to change their original selection from the original drop down box (e.g. from B to A) - the code remembers the user value of Input X when in fact, if a change is made to the drop down menu, I want Input X to be reset to 0.
Hence is it possible to make the change on the drop down echo BOTH the selection made AND reset INPUT X to zero?
An example of the current code is summarized below :
<td><select name="optionab" onChange = "submit_form(ad_create_form,'');">
<option value="a" selected><?=MSG_A;?></option>
<option value="b" <? echo ($details['optionab']=='B') ? 'selected' : ''; ?>><?=MSG_B;?></option>
Ideally, I want to echo INPUT X = 0 on change but not sure how to do that?
Thanks in advance