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

label element and select

Status
Not open for further replies.

bigoldbulldog

Programmer
Feb 26, 2002
286
US
Hi -

I have a label element with for="some_select_list". Whenever the label is clicked the select goes into focus. The problem is that the selectedIndex always returns to zero when I want it unchanged.

Any ideas how to have the selectedIndex remain unchanged?

Thank you. Cheers,
ND [smile]

bigoldbulldog@hotmail.com
 
You could change your label to a link that sets the focus to the select box and that has style to make it look like regular text. You could also add onmouseover="window.status='';return true" to keep anything from showing up in the status bar.
 
I solved this with an onClick event. I changed

<th><label for=&quot;site&quot;>Site</label></th>

to

<th onClick=&quot;document.all.chooser.site.focus()&quot;>Site</th>

Now I get focus on the chooser form's site-select element when users click the header. Cheers,
ND [smile]

bigoldbulldog@hotmail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top