Connecting Tech Pros Worldwide Forums | Help | Site Map

document.getElementById('whatever').click() does not work in Firefox

Newbie
 
Join Date: May 2007
Posts: 1
#1: May 3 '07
HI,

I have encountered this:

document.getElementById('Show').click() does not work in Firefox

I also tried:

document.getElementById('Show').submit.click() with the same result.

I have an asp: LinkButton like this:

<asp:LinkButton id="Show" Runat="server"><img name="myimage" src="show.gif"></asp:LinkButton>

I now want the onClick() event of this LinkButton to fire when I actually click another similar button (BUT2) on my form. I want to do this via javascript 'coz there are some other tasks to be done in the event handler of the other button (BUT2) before I actually want this button (Show) to be 'clicked'.

Thanks for your help!
Whiz.

iam_clint's Avatar
Forum Leader
 
Join Date: Jul 2006
Location: Oklahoma
Posts: 1,076
#2: May 3 '07

re: document.getElementById('whatever').click() does not work in Firefox


no element.click(); does not work in firefox what you will have todo is read what the onclick event is doing and then run it along with your other buttons on click event

element.getAttribute("onclick");
Reply