The solution I offered was client side. For your submit you could just use a regular HTML submit and not a server control if that is possible. Otherwise the page's IsPostBack property might provide some help.
HTH, Todd -----Original Message----- From: Matthew Small [mailto:[EMAIL PROTECTED]] Sent: Friday, September 27, 2002 3:02 PM To: dotnet Subject: RE: Adding javascript onlcikc event to a button which already has one I'm still not understanding your solution. You wrote: "One trick would be to put a hidden element in the form with an initial Value of 1. When the form is initially submited have this value changed to 2. Have an if statement in your javascript that check the value. If the Value is 2, then short-circuit the submit and display a message." How do I know when the form is initially submitted if I can't use button.onclick or form.onsubmit? I can't use either of those because ASP.NET Webforms uses those events already and I can't overwrite them, nor can I figure out how to add to them. All I really want to do is figure out how to tell if the form has been submitted without using either of those events. 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: Todd Pull [mailto:[EMAIL PROTECTED]] Sent: Friday, September 27, 2002 10:45 AM To: dotnet Subject: RE: Adding javascript onlcikc event to a button which already has one Just add: document.nameofyourform.submit(); modified code would be: function changehidden() { if (document.all.hidden.value == 1)// value is initially 1 to indicate //form //has not been //submitted already { document.all.hidden.value = 2; document.nameofyourform.submit(); //continue the submit process } else { window.alert("Data previous submitted; waiting results"); } } A real good book for client side script is: "Dynamic HTML The Definitive Reference" printed by O'Reilly HTH, Todd -----Original Message----- From: Matthew Small [mailto:[EMAIL PROTECTED]] Sent: Friday, September 27, 2002 9:49 AM To: dotnet Subject: RE: Adding javascript onlcikc event to a button which already has one How can I tell if the form has been submitted without using form.onsubmit()? 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: Todd Pull [mailto:[EMAIL PROTECTED]] Sent: Friday, September 27, 2002 9:34 AM To: dotnet Subject: RE: Adding javascript onlcikc event to a button which already has one One trick would be to put a hidden element in the form with an initial value of 1. When the form is initially submited have this value changed to 2. Have an if statement in your javascript that check the value. If the value is 2, then short-circuit the submit and display a message. Something like: function changehidden() { if (document.all.hidden.value == 1)// value is initially 1 to indicate form has not been //submitted already { document.all.hidden.value = 2; return true; //continue the submit process } else { window.alert("Data previous submitted; waiting results"); return false; //stop submit process } } HTH, Todd -----Original Message----- From: Matthew Small [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 26, 2002 3:12 PM To: dotnet Subject: RE: Adding javascript onlcikc event to a button which already has one Hi, I've been trying this and variations of this with no success. Anybody else got any ideas? Thanks for your help 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: Alex Dresko [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 26, 2002 2:03 PM To: dotnet Subject: RE: Adding javascript onlcikc event to a button which already has one Try something like this in your code.. myButton.Attributes["OnClick"} += "AnotherJavascriptFunction();"; Depending on what the existing OnClick code looks like, you might have to do this in order to add another Javascript function to the command. myButton.Attributes["OnClick"} += ";AnotherJavascriptFunction();"; Alex Dresko Three Point Oh! -----Original Message----- From: Matthew Small [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 26, 2002 1:16 PM To: dotnet Subject: Adding javascript onlcikc event to a button which already has one Hi - I'm using ASP.NET(VB) webforms. I want to add a small javascript line that causes my button to change its value when clicked upon - from "Submit Purchase" to "Please Wait" so the form does not get clicked more than once when the user is waiting for a response. I've tried adding an attribute to the button in question, and it does get there. The problem is that the button already has an onclick event line that overrides the one that I want to use. I've thought about using onformsubmit, but I have the same problem there. Anybody got any ideas? Thanks Matthew Small IT Supervisor Showstopper National Dance Competitions 3660 Old Kings Hwy Murrells Inlet, SC 29576 843-357-1847 http://www.showstopperonline.com --- 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.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.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.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.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.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.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: archive@jab.org 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/