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

Select option issue with function

Status
Not open for further replies.

cleanair4me

Technical User
May 16, 2008
61
I have a function that works with input text onblur but wont work with select option.
Here is example of how it works with input text where the user enters a city and populateFullname() function automatically populates the fullname field with a value:
Code:
<input type="text" name="city" onBlur="populateFullname();">
<input type="text" name="fullname">

If I try the same attempt for select option where I can only select one value it doesnt work using onBlur.
I also tried using onChange, onFocus and onSelect but it didnt populate the fullname value.

Code:
<select name="city" onChange="populateFullname();" onFocus="populateFullname();" onBlur="populateFullname();">
<option value="Oakland">Oakland</option>
<option value="Cleveland">Cleveland</option>
<option value="Boston">Boston</option>
</select>
<input type="text" name="fullname">

Please advise any other things I can try that can work with select option?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top