Wrox Programmer Forums
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old June 12th, 2004, 01:20 PM
Friend of Wrox
Join Date: Oct 2003
Posts: 336
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to alyeng2000
Default submit using jscript

i am using asp.net and i have many server button controls
i need to submit to certain one using jscript ...
is that possible????

Ahmed Ali
Software Developer
Ahmed Ali
Senior Software Developer
Old June 12th, 2004, 05:46 PM
Friend of Wrox
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts


It might be possible, although could you elaborate more... what exactly do you need to do? I'm not quite sure I understand.


Old June 13th, 2004, 02:47 AM
Friend of Wrox
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
Send a message via Yahoo to melvik

excuse me what do u mean by submit to certain one?!

Hovik Melkomian.
Old June 14th, 2004, 07:38 AM
planoie's Avatar
Friend of Wrox
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts

You can fire a certain button simply by calling its "click()" method.

<asp:button id="cmdSave" runat="server" />

<script language="javascript">

Just be aware of the name of the button. If the form is not the default form name (Form1) or the button is actually part of a user control you'll need to use another method for getting the name of the button. I try to be consistant and use the server control's .ClientID property to get the ASP.NET generated client-side ID for the control and then use the getElementById() method in the javascript. As a result you'll have to manipulate the client-side javascript with server code.

<script language="javascript">
   document.getElementById('<control.ClientID goes here>').click();

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to submit the different data on single submit pushpa Classic ASP Databases 1 January 24th, 2007 07:10 PM
JScript DumAss HTML Code Clinic 1 August 25th, 2004 02:46 AM
How can we submit a form without a submit butto phpsharma BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 4 October 20th, 2003 08:50 AM
JScript Des67 Javascript 1 July 28th, 2003 05:05 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.