Thanks, that's exactly what I wanted it to do. Matthew Small IT Supervisor Showstopper National Dance Competitions 3660 Old Kings Hwy Murrells Inlet, SC 29576 843-357-1847 http://www.showstopperonline.com
-----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Monday, September 30, 2002 11:20 AM To: dotnet Subject: RE: Adding javascript onlcikc event to a button which already has one If all you want to do is execute some script on submission of the form, use Page.RegisterOnSubmitStatement(string key, string script). The caveat to this is that it won't work for the auto postback feature of ASP.NET... So LinkButtons, autopostback drop down lists, etc won't fire this event, only actual submit buttons will: *** HTML *** <script type="text/javascript"> function doSomething() { alert("hello"); } </script> *** Page_Load *** string script = "doSomething();"; this.RegisterOnSubmitStatement("myscript", script); *** Output *** <form name="Form1" method="post" action="WebForm1.aspx" language ="javascript" onsubmit="doSomething();" id="Form1"> adam.. >I was trying to do client side stuff, that is the problem. > >Apparently, ASP.NET already uses client-side form.onsubmit and >submit.onclick when it writes the code for webforms. What I wanted to >do was put my own function in the client script that uses submit.onclick >or form.onsubmit. But I can't figure out how to add my javascript to >the code that .NET generates. --- You are currently subscribed to dotnet as: [EMAIL PROTECTED] To unsubscribe send a blank email to %%email.unsub%% --------- Administrated by 15 Seconds : http://www.15Seconds.com List Archives/Search : http://local.15Seconds.com/search Subscription Information : http://www.15seconds.com/listserv.htm Advertising Information: http://www.internet.com/mediakit/ --- You are currently subscribed to dotnet as: [email protected] To unsubscribe send a blank email to [EMAIL PROTECTED] --------- Administrated by 15 Seconds : http://www.15Seconds.com List Archives/Search : http://local.15Seconds.com/search Subscription Information : http://www.15seconds.com/listserv.htm Advertising Information: http://www.internet.com/mediakit/
