Click to See Complete Forum and Search --> : Dom with cookies?


b1021
12-02-2003, 10:12 PM
I create a page that creates a form on the onload event and I'm wondering what's the best way to go about retaining the users information if the hit the back button on their browser. Current when the user goes to my page, a function is called in javascript off of the body onload event, then the javascript function creates the form the user enters values in then submits. If the user then clicks the back button on the browser, now their information is go since the onload event has fired. What is the best way to keep the users data, cookies?? I'm not too sure how I'd go about this since the form thats created can change based on user input.

TIA

Brian

Khalid Ali
12-03-2003, 12:18 AM
just out of curiosity,why are you creating simple html form with JavaScript?(that to me seems like a bad logic unless of course if there are some iother reasone)

If you just use HTML form then the browser keeps all the data user entered in cache and when they click back,the form fields will have the data

b1021
12-03-2003, 11:13 PM
What I'm trying to do is have a form that has an unlimited number of user options to select from (select boxes) The select boxes source (I'm using arrays to drive my javascript, which is being created in a nightly process) are being created from a db table that is continually being updated. Based on what is set up in the db table the form can have unlimited combination of select boxes. It just depends on what is set up in the db table.

Hopefully this is the best solution. :) Please let me know if there is a more effient method of accomplishing this.

Tia

Brian