I am trying to make a selection box keep the selected value after the page is reloaded.
This is a form for people to select which year of car they want to search on. There is a keyword and then an onsubmit function which attaches a 2 letter year to the keyword and submits it to the search page. The user has to select the keyword from a dropdown selection box.
After the search is performed, the person is taken to the results, but the selection box resets. When people search again and again, they have to keep opening the dropdown and selecting their year. any ideas how to keep the selection after the search is done?
Here is the FORM Code
-----------------------------------------------------------
<form id="find_spec" name="find_spec" method="post" action="<*SearchResultspageURL*>" onsubmit="appendgeneration();">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td><input type="hidden" id="searchtype" name="searchtype" value="AND"><input name="find_spec" type="text" class="searchbox1" id="keyword" onFocus="this.value=''" value=" Part# or Keyword(s)" maxlength="50">
</td>
<td nowrap>
<img src="<*ImageURL*>filltop.gif" width="2" height="1">
<select class="searchbox" id="generation">
<option value="Corvette" selected>Year</option>
<option value="Corvette">ALL</option>
<option value="07">2007</option>
<option value="06">2006</option>
<option value="05">2005</option>
<option value="04">2004</option>
<option value="03">2003</option>
<option value="02">2002</option>
<option value="01">2001</option>
<option value="00">2000</option>
<option value="99">1999</option>
<option value="98">1998</option>
<option value="97">1997</option> </select></td>
<td align="center" valign="middle" nowrap><input name="btnSearch" type="image" id="btnSearch2" value="Search" src="<*ImageURL*>go3.gif" width="40" height="20"></td>
</tr>
</table>
</form></div>
----------------------------------------------------------
I've been told to do it by simply outputting selected="selected" at the option that was chosen.
I need more information, what is the javascript function code? I have no knowledge of writing javascript.
This is a form for people to select which year of car they want to search on. There is a keyword and then an onsubmit function which attaches a 2 letter year to the keyword and submits it to the search page. The user has to select the keyword from a dropdown selection box.
After the search is performed, the person is taken to the results, but the selection box resets. When people search again and again, they have to keep opening the dropdown and selecting their year. any ideas how to keep the selection after the search is done?
Here is the FORM Code
-----------------------------------------------------------
<form id="find_spec" name="find_spec" method="post" action="<*SearchResultspageURL*>" onsubmit="appendgeneration();">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td><input type="hidden" id="searchtype" name="searchtype" value="AND"><input name="find_spec" type="text" class="searchbox1" id="keyword" onFocus="this.value=''" value=" Part# or Keyword(s)" maxlength="50">
</td>
<td nowrap>
<img src="<*ImageURL*>filltop.gif" width="2" height="1">
<select class="searchbox" id="generation">
<option value="Corvette" selected>Year</option>
<option value="Corvette">ALL</option>
<option value="07">2007</option>
<option value="06">2006</option>
<option value="05">2005</option>
<option value="04">2004</option>
<option value="03">2003</option>
<option value="02">2002</option>
<option value="01">2001</option>
<option value="00">2000</option>
<option value="99">1999</option>
<option value="98">1998</option>
<option value="97">1997</option> </select></td>
<td align="center" valign="middle" nowrap><input name="btnSearch" type="image" id="btnSearch2" value="Search" src="<*ImageURL*>go3.gif" width="40" height="20"></td>
</tr>
</table>
</form></div>
----------------------------------------------------------
I've been told to do it by simply outputting selected="selected" at the option that was chosen.
I need more information, what is the javascript function code? I have no knowledge of writing javascript.