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

REFRESHING A DROPDOWN - HELP

Status
Not open for further replies.

kingjjx

Programmer
Joined
Sep 18, 2001
Messages
181
Location
US
Hi, I have a search page that contains a couple of dropdown lists. the dropdown list is not dynamically generated.

Now when the user clicks on search it returns the query results. MY problem is when the user clicks on the browser's back button .. the dropdown does not refresh.

How can I make the dropdown refresh, everytime the user clicks back. I do not want it to refresh every 15 seconds or so but I jsut want to refresh the dropdown/ page everytime the user gets back to the page.
please help
thanks

 
what you can do is to use the onLoad event to determine when the page has finished loading. Then if all you want to do is to set the select box back to the default you use a bit of javascript

so your call would look like this:

function resetIt() {
document.nameofyourform.nameofyourselectbox.selectedIndex = 0
}

this will set the default/displayed value to the 1st entry in your select box.

you will call this from the onload event in the body tag

<body onLoad=&quot;resetIt()&quot;>

hope this helps !
 
hey .. the code didnt work !
please help
 
can you post your code up an i'll have a look !
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top