Firefox not firing button event programmatically from JavaScript but

Firefox not firing button event programmatically from JavaScript but

am 11.01.2008 00:23:48 von Braden.Bowers

We have a page that contains an .ascx user control. That control has
an image button that when clicked fires a JavaScript function on the
container page. The JavaScript function finds an on
the container page using.

var btn = document.getElementById('<%= MyButton.ClientID %>');

OnClick="ProcessControlAction" CssClass="Hidden" />

Then we fire that buttons onClick event.

if (btn != null ) { b.click(); }

On IE7 (Windows), IE6 (Windows), and Safari (Mac) this process runs
fine, the code behind function for MyButton fires and the web
application proceeds . Firefox however on both windows and mac gets
completely through the javascript function without throwing a
javascript error but the MyButton event never fires. Please help us
find a work-around for this problem.

Thanks in advance
Braden Bowers

Re: Firefox not firing button event programmatically from JavaScript

am 11.01.2008 00:45:50 von Braden.Bowers

On Jan 10, 4:23=A0pm, Braden.Bow...@gmail.com wrote:
> We have a page that contains an .ascx user control. =A0That control has
> an image button that when clicked fires a JavaScript function on the
> container page. =A0The JavaScript function finds an on
> the container page using.
>
> var btn =3D document.getElementById('<%=3D MyButton.ClientID %>');
>
> > OnClick=3D"ProcessControlAction" CssClass=3D"Hidden" />
>
> Then we fire that buttons onClick event.
>
> if (btn !=3D null ) { b.click(); }
>
> On IE7 (Windows), IE6 (Windows), and Safari (Mac) this process runs
> fine, the code behind function for MyButton fires and the web
> application proceeds . Firefox however on both windows and mac gets
> completely through the javascript function without throwing a
> javascript error but the MyButton event never fires. =A0Please help us
> find a work-around for this problem.
>
> Thanks in advance
> Braden Bowers

Hate this get frustrated and figure it out 5 minutes after posting
this question to groups.google.com
I'm assuming that since the chain of events originated from the user
control it's trying to fire an event named "ProcessControlAction" on
the .ascx which doesn't exist. You need to add PostBackUrl=3D"<
Container page url >".

"
UseSubmitBehavior=3D"false" runat=3D"server"
OnClick=3D"ProcessControlAction" CssClass=3D"Hidden" />

Hope this saves someone else hours of research.

Braden Bowers