...

View Full Version : How to simulate a button click?



RadarBob
06-22-2005, 06:34 PM
How might I simulate a button click w/ Javascript?

I am not asking how to call code that an event invokes. I want to fire the event itself.

Why don't I just create my own eventHandler and call it myself? Because I don't know how our form-building tool implemented it. It's not exposed for programmatic use.

Willy Duitt
06-22-2005, 07:03 PM
click

RadarBob
06-22-2005, 07:25 PM
as in getElementById("button name").click ?

Willy Duitt
06-22-2005, 07:27 PM
as in getElementById("button name").click ?

yeppers... :thumbsup:

glenngv
06-23-2005, 05:12 AM
Should be document.getElementById("button Id").click()
But that only works in IE. To make it work in Firefox, you have to do this (http://www.codingforums.com/showpost.php?p=34595&postcount=5).

enumerator
06-23-2005, 05:36 AM
What about object.onclick();?

Oh, nevermind... wasn't paying attention. ;)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum