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

DOM - select field and JS event ... does that work?

Status
Not open for further replies.

kimera

MIS
Nov 6, 2000
15
CH
Hi.

I try to hide a <div> object when the user clicks or focus' the an option within a select field. But that doesn't work. However, it works if I put that onclick event right after <select name=... onclick=&quot;akfja()&quot;>.

Can somebody tell me how I could have appear second select filed if a user focus' an option of that select menu?
 
I regret it doesn't work on the level <OPTION value ...> of the select field. On the top level of the select field only!!! Any other ideas?

anyway, thanks for your help
 
then let the onchange fires at the select level
and in the function you call in the onchange, check which option is selected, if it's one of those you want, make the 2nd select field appear
something like :
function display_field() {
if (the_form.the_select_field.options[the_form.the_select_field.selectedIndex].value==&quot;anything&quot;)
// then show the 2nd field
}
and
<select name=the_select_field onchange=&quot;display_field()&quot;>
...
</select>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top