Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

selection list value in cookie to maintain selection when user returns

Status
Not open for further replies.

cbsarge

IS-IT--Management
Jun 20, 2001
219
US
I have a javascript function that uses a bunch of selection lists, some containg numbers and some containing text, and was wondering how I could save the selected values so when the user returns to the site the previously selected items are already selected.

So if I had a selection list like the one below and the user picked 4 and yellow then when they returned to the webpage for another visit then the selection lists would already be on 4 and yellow.

Code:
<form style="display: inline">
<SELECT class="FJselect" name="numberloadouts" style="width: 50px" id="FJsloadouts" onchange="LoadoutNUM = this.options[selectedIndex].value;">
<OPTION class="FJoptionBG1" selected value="1">1</OPTION>
<OPTION class="FJoptionBG2"value="2">2</OPTION>
<OPTION class="FJoptionBG1"value="3">3</OPTION>
<OPTION class="FJoptionBG2"value="4">4</OPTION>
<OPTION class="FJoptionBG1"value="5">5</OPTION>
</SELECT>
</form>
<form style="display: inline">
<SELECT class="FJselect" name="loadout" style="width: 50px" id="FJsldts" onchange="LdtNUM = this.options[selectedIndex].value;">
<OPTION class="FJoptionBG1" value="red">red</OPTION>
<OPTION class="FJoptionBG2" value="blue">blue</OPTION>
<OPTION class="FJoptionBG1" value="green">green</OPTION>
<OPTION class="FJoptionBG2" value="yellow">yellow</OPTION>
<OPTION class="FJoptionBG1" value="orange">orange</OPTION>
</SELECT>
</form>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top