I have a web form that has several pull down menus and text fields. I have a button at the end of the page “Clear” and onclick I enter my clearinput(). All my clearinput does is set
document.AdvSearchForm.textNamefield = “”; for each and every text field.
Now every text input field is set to null. However, when my screen is repainted not only are all my input fields blank, but all my select pull down menus have been returned to their original state of index=0. I wanted them to stay with their selected valued. As long as selectedIndex is not being reset or document.AdvSearchForm.searctype[x].selected is not changed (true/false), why are all my select indexes going back to 0? An example of one pull down menu is
<tr>
<td height=”28″ align=”right” valign=”middle” bgcolor=”#DDDDDD” class=”style25″ >
Search Type:
</td>
<td colspan=”2″ valign=”middle” bgcolor=”#DDDDDD”>
<select id=”MySelect” name=”searchtype” onchange=”TransactionHandler()”>
<option selected=”selected” value=”0″> </option>
<option value=”1″>By Filer Name</option>
<option value=”2″>By Filer Account ID</option>
<option value=”3″>By Contributor/Payee</option>
<option value=”4″>By Fields other than Name/ID</option>
</select>
</td>
</tr>
Should I remove the selected=”selected” for my first pull down option?
Thanks!