[Project_owners] capturing "enter" key for <window/> and <dialog/>?

Michael Vincent van Rantwijk some at universum.org
Wed May 25 16:04:24 EDT 2005


Michael Vincent van Rantwijk wrote:

> Eric Jung wrote:
> 
>> Excellent, thanks! I remember reading the docs for <button/> on
>> XULPlanet once and seeing an attribute which "highlighted" the
>> default button by drawing a thicker border around it. Now I can't
>> find that attribute.
>>
>> Anyone happen to know what it is?
> 
> 
> 
> Erix, this example might help you;
> 
>   setDefaultButton: function()
>   {
>     var dialogButton = document.documentElement.getButton("accept");
>     dialogButton.removeAttribute("default");
>     dialogButton = document.documentElement.getButton("cancel");
>     dialogButton.setAttribute("default", "true");
>     dialogButton.focus();
>   }

Oops, pardon me, that should be Eric :-)


More information about the Project_owners mailing list