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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Losing the cookie on form reload

Status
Not open for further replies.

KingElvis

Programmer
Jan 28, 2004
39
0
0
IL
How does one retain the value of a drop-down box when the form is re-loaded after a verification routine?

I have a dropdown box:


<select name="shiurFreq" size="1" tabindex="8" onchange="if(this.selectedIndex == 1)
{document.Frontpage_form1.shiurDateText.style.display='inline'; document.Frontpage_form1.syear.style.display='inline';}
else
{document.Frontpage_form1.shiurDateText.style.display='none';
document.Frontpage_form1.syear.style.display='none';}">


The value returned is saved in a cookie:

<option selected>Shiur Frequency <%=SF_GetshiurFreqSELECT(Request.Cookies(consts_CollectionName_Shiur)("shiurFreq"))%>
</select>

However, when the form is reloaded after failing a verification routine, the values previously entered disappear (there is no 'onChange' event on reload).

How does one retain the previously entered values?
 
You need a value in the form then you can just do this:

<option value='tulip'<%If Request.form("select_field")="tulip" then Response.write " selected"%>

www.sitesd.com
ASP WEB DEVELOPMENT
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top