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

changing/resetting a value in a form

Status
Not open for further replies.

tennis

Technical User
Aug 23, 2001
18
US
I have an html form that contains a couple of select lists. By default both lists are set to "ALL" and if a user changes a value (using onchange ) some comparisons with the value are made. For instance if one of the select lists is country and another is city , if a user selects a city that is not in the country I would like to "reset" the value of city back to its original state, "All".

I'm calling a function and sending it the variable form.

Is it possible to reset the value of city back to it's original state without resetting the entire page?

Thanks in advance,

Extreme newbeeeee
 
Hmm.

Surely in the validation of the Form, you are validating City against Country. So if the City doesn't match the Country, then you can forcibly change teh data in any of the text boxes using the following:

RegiForm.UserName.value = userName;
This assumes:
1. a Form named RegiForm
2. a Field called UserName within RegiForm

You then just say what you the value to revert/change/be in the first place. Dunno if that helps.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top