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!

blurring a drop down menu when a page (re)loads

Status
Not open for further replies.

rowanco

Programmer
Jul 17, 2001
9
AU
I have a drop down menu of links to pages with an 'onchange' activation, that I want to blur whenever the page loads or reloads.

If it this dosen't happen and the visitor clicks the back button to return to the page with the drop down menu, it remains focussed, and if they say, use a mouse wheel intending to scroll the page, it will scroll the drop menu selections instead, and then load on the link corresponding to the newly selected choice and leave the page.

I have tried putting a function call in the BODY onload event handler, to blur the form element, as in:

document.form[0].element[0].blur();

(which is the correct element)but this dosen't. If I do a reset(), this will work (but the element still remains focussed).

if at the end of the end of the function there is an alert() call(for debug) this seems to trigger the blur() and it works (but I can't have alert() call in the final version), I have tried various combinations of return values for the function and straight script calls, none seem to work.

Can anybody help?
Thanks.
 
Can you try just putting focus on another field instead of trying to blur that one? Hope this helps,
Jessica
[ponytails2]
 
Thanks, but unfortunately I can't have the focus on any of the elements (most pages only have the one anyway)....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top