Simulating a click in a <browser> XUL element

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Simulating a click in a <browser> XUL element

NMONNET
Greetings,

I'm writing a XUL app that occasionally needs to "click" on a submit
button. Is there a way to do this simply? I've been told to createEvent
"click" and then pass it on to the DOM, how's that done?

And then, what is the appropriate newsgroup to discuss such matters?

Thanks in advance ...

_______________________________________________
mozilla-dom mailing list
[hidden email]
http://mail.mozilla.org/listinfo/mozilla-dom
Reply | Threaded
Open this post in threaded view
|

Re: Simulating a click in a <browser> XUL element

Todd Fisher
I think the easiest way is to give your button an id.  Then call:

document.getElementById("yourbuttonid").click();

not sure about which group is appropriate...

-Todd

NM wrote:

> Greetings,
>
> I'm writing a XUL app that occasionally needs to "click" on a submit
> button. Is there a way to do this simply? I've been told to createEvent
> "click" and then pass it on to the DOM, how's that done?
>
> And then, what is the appropriate newsgroup to discuss such matters?
>
> Thanks in advance ...
>
> _______________________________________________
> mozilla-dom mailing list
> [hidden email]
> http://mail.mozilla.org/listinfo/mozilla-dom
>  


_______________________________________________
mozilla-dom mailing list
[hidden email]
http://mail.mozilla.org/listinfo/mozilla-dom
Reply | Threaded
Open this post in threaded view
|

Re: Simulating a click in a <browser> XUL element

Boris Zbarsky
In reply to this post by NMONNET
NM wrote:
> I've been told to createEvent
> "click" and then pass it on to the DOM, how's that done?

See the DOM 2 Events specification.

-Boris
_______________________________________________
mozilla-dom mailing list
[hidden email]
http://mail.mozilla.org/listinfo/mozilla-dom
Reply | Threaded
Open this post in threaded view
|

Re: Simulating a click in a <browser> XUL element

NMONNET
In reply to this post by NMONNET
On Tue, 18 Oct 2005 08:41:08 -0400, Todd Fisher wrote:

> I think the easiest way is to give your button an id.  Then call:
>
> document.getElementById("yourbuttonid").click();
>
> not sure about which group is appropriate...

Thank you, it just worked. No need to manage events etc.


_______________________________________________
mozilla-dom mailing list
[hidden email]
http://mail.mozilla.org/listinfo/mozilla-dom