Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > javascript command to implement button control

Reply
Thread Tools

javascript command to implement button control

 
 
Steve
Guest
Posts: n/a
 
      05-28-2006
asp.net 2.0

I have a simple button control which implements some page behind code
when it is clicked.

I am looking for a simple javascript command which will in effect cause
a click on the button. i.e. act as if someone has clicked on the
button. i.e. do the same thing.

I will be calling this javascript command from another normal html
button on the page where I can't use asp.net. I know it seems like a
strange request, but there is a good reason for it.

Can anyone help?

 
Reply With Quote
 
 
 
 
=?ISO-8859-1?Q?G=F6ran_Andersson?=
Guest
Posts: n/a
 
      05-28-2006
document.getElementById('IdOfTheButtonToClick').cl ick();

Steve wrote:
> asp.net 2.0
>
> I have a simple button control which implements some page behind code
> when it is clicked.
>
> I am looking for a simple javascript command which will in effect cause
> a click on the button. i.e. act as if someone has clicked on the
> button. i.e. do the same thing.
>
> I will be calling this javascript command from another normal html
> button on the page where I can't use asp.net. I know it seems like a
> strange request, but there is a good reason for it.
>
> Can anyone help?
>

 
Reply With Quote
 
 
 
 
Steve
Guest
Posts: n/a
 
      05-28-2006
Excellent. Thank you so much for that Goran. It really helped me out a
lot.

 
Reply With Quote
 
Laurent Bugnion
Guest
Posts: n/a
 
      05-28-2006
Hi,

Göran Andersson wrote:
> document.getElementById('IdOfTheButtonToClick').cl ick();


To be complete, this does not work in Firefox.

Looking for a better way now.

HTH,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
Private/Malaysia: http://mypage.bluewin.ch/lbugnion
Support children in Calcutta: http://www.calcutta-espoir.ch
 
Reply With Quote
 
Laurent Bugnion
Guest
Posts: n/a
 
      05-28-2006
Laurent Bugnion wrote:
> Hi,
>
> Göran Andersson wrote:
>
>> document.getElementById('IdOfTheButtonToClick').cl ick();

>
>
> To be complete, this does not work in Firefox.


Of course it does. My wrong, sorry. I tested using a button with a
"name", but without an "id", and document.getElementById fails in
Firefox (which is correct). However it succeeds in IE (wrongly).

So to summarize, click() is also available in Firefox.

Sorry about the confusion.

Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
Private/Malaysia: http://mypage.bluewin.ch/lbugnion
Support children in Calcutta: http://www.calcutta-espoir.ch
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[RFC] How to implement command line tool integrating parsing engine llandre Python 2 03-22-2008 03:02 PM
Make an HTML button look like WebControl command button jimryder@gmail.com ASP .Net 0 07-20-2006 08:05 AM
Responding to Button control events when Button is added to a Table Control Jim Gilligan ASP .Net Web Controls 0 09-01-2005 06:29 PM
How to call javascript when click update command(it Edit command c prakash ASP .Net Web Controls 2 04-11-2005 04:07 AM
Building a custom control that implement table server control Thomas Ekegren ASP .Net Building Controls 2 07-20-2003 09:27 PM



Advertisments