Advertisement

07.19.2006 at 01:33AM PDT, ID: 21924170
[x]
Attachment Details

How to set focus() on a button without activating it?

Asked by YossiBa in Hypertext Markup Language (HTML)

Tags: activating, focus, set, without

Hi helper,
I have the following button:

<BUTTON id="associateBtnId" name="associateCmd" onclick="submitAssociate();"  tabindex="2"  onmouseover="changeApearance(this, 'over')" onmouseout="changeApearance(this, 'out')" styleClass="sbttn">
Associate
</BUTTON>

When I activate  - document.getElementById('associateBtnId').focus();

The focus is shift to the button and it is activated as well!! I just want the focus to be on the button and thats it. when the user descide to activate he should press Enter.
How can I shift the focus to the button without activating it?
Thanks
Yossi

* 165 is all the points I got :-(
Start Free Trial
 
 
[+][-]07.19.2006 at 01:41AM PDT, ID: 17136692

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.19.2006 at 02:11AM PDT, ID: 17136801

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.19.2006 at 02:24AM PDT, ID: 17136843

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Hypertext Markup Language (HTML)
Tags: activating, focus, set, without
Sign Up Now!
Solution Provided By: ivostoykov
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32