473,396 Members | 2,016 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

javascript command to implement button control

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?

May 28 '06 #1
4 1243
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?

May 28 '06 #2
Excellent. Thank you so much for that Goran. It really helped me out a
lot. :-)

May 28 '06 #3
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
May 28 '06 #4
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
May 28 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Trvl Orm | last post by:
I am working with 2 frames, Left and Right and the main code is in the left frame, which has been attached. Can someone please help me with this code. I am new to JavaScript and can't figure it...
9
by: Melissa | last post by:
What is the code to delete a command button from a form? Can the code be run from the click event of the button to be deleted? Thanks! Melissa
2
by: Angel | last post by:
How do I associate a server side command button to a Javascript function that is in the Web Form HTML Code? Thanks
14
by: Kevin | last post by:
A couple of easy questions here hopefully. I've been working on two different database projects which make use of multiple forms. 1. Where's the best/recommended placement for command buttons...
2
by: Kevin S. Goff | last post by:
Hi....I realize this is a really basic question.... I have a webform (in VS.NET 2005). It has (among other things) a combobox and a command button. At the beginning, the command button is...
0
by: jonathan.beckett | last post by:
I have been working on a client project recently that is using winforms ..NET user controls within web pages in Internet Explorer, and need to find out how to make the user control communicate back...
6
by: anoop | last post by:
Hello, I want to implement client side MD5 hash for Login Control using Javascript. how do I implement this. Thank you
16
by: Tony Girgenti | last post by:
Hello. I just finished reading two articles about javascript here: http://msdn2.microsoft.com/en-us/library/bb332123(VS.80).aspx I tried some javascript testing in VS2005, SP1, VB , .NET 2.0,...
8
by: mike_solomon | last post by:
I have a button <input type="submit" name="Delete" value="Delete"> This code can not be changed I want to use Javascript to change the type I tried:
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.