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

history.back() related question 1

Status
Not open for further replies.

Mighty

Programmer
Feb 22, 2001
1,682
US
Guys,

I have a form page which has three select boxes. Using the user selections, I have a javascript function which creates a HTML document and outputs it to the screen using document.write(). A part of this new HTML page is a link back to the forms page using history.back(). However, i would like to clear the select boxes on the forms page so that the user's previous selections are not still selected. I would prefer not to reload the page from the server and it takes time to populate the select boxes.

Can this be done? Mise Le Meas,

Mighty :)
 
Why woould you want to do that, its so annoying when you have to type in information again on forms..
 
The function of the form is to allow a user to check the stock levels for given products. If they select a product and then submit the form, they have the option to go back and choose another product to check. I want the select boxes blanked so that their previous choice is not showing in the select box. Mise Le Meas,

Mighty :)
 
Instead of using history.back(), why not just specify the actual url of the page? Thats what I did, and it works great.
 
I don't want to specify the URL because that would cause it to reload the page. This takes too long as it has to read from a database to populate the list boxes. Therefore, I only want to have to load the page from the server once. Mise Le Meas,

Mighty :)
 
why not try something similar to "onload='formName.reset()'" in the body tag of the page you're returning to?
 
ChainsawJoe,

I never thought of that.
I have tried it out and it seems to work.
Cheers. Mise Le Meas,

Mighty :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top