PDA

View Full Version : How do I reset a pull-down menu that uses an array?


thorman
02-03-2003, 02:42 PM
I have a form setup that allows a user to make a selection in a pull-down menu that then gives them additional options in another pull-down menu based on their selections in the first pull-down.

Everything works just fine, but if the user returns to the form after viewing the response page the pull-down menus don't reset and the options in the second menu are no longer available.

Is there a way to reset the page so when the user returns either the options are still available or the form reloads? I've attached my code in .txt format.

requestcode
02-03-2003, 03:45 PM
You might try using the onLoad event in your body tag to reset the form like this:
<BODY onLoad="document.form_name.reset()">

"form_name" of course being the name you gave the form.

glenngv
02-05-2003, 02:18 AM
what thorman meant was not form reset. He wants when the user returns to that page, the added select options should still be there.

thorman, how do the user return to the page? by pressing the BACK button? or you have a link or you redirect to that page?

if via BACK button, you have to save the added options in the cookie, then on window onload, populate the options. There are many cookie scripts out there, here is one: http://codingforums.com/showthread.php?s=&threadid=11585

if you have a link or you redirect to that page, then you have to save the added options in db (or any other means), then just populate the options via server-side.