Okay so "switch bounce" I'm sure is the wrong term, but I mean when the idiot user enters his credit card details, presses the pay button, presses it again, and again, and again, and then you end up with four orders.
Is there a good way of stopping this? I was thinking I'd disable the pay button on click with some client side code. I found this off the net:
Which works. The problem is I have some validators on the form, and if they fail the button still gets disabled.
So my second thought was to disable the button as part on the on Submit:
Which adds the PayButton.disabled line to the client side onSubmit function after the validation. Which would appear to be the right thing, except the button disable doesn't work. I thought it might not know about PayButton at that point, but I tried changing PayButton.disabled to Wibble.disabled, and that came up with a script error, which proves it at least knows what the PayButton object is.
Presumably all you professionals must solve this problem twenty times a day. So what's the best approach?
Ta.
Is there a good way of stopping this? I was thinking I'd disable the pay button on click with some client side code. I found this off the net:
Code:
PayButton.Attributes.Add("onclick", "this.disabled=true;" + Page.ClientScript.GetPostBackEventReference(PayButton, "").ToString());
So my second thought was to disable the button as part on the on Submit:
Code:
System.Web.UI.HtmlControls.HtmlForm frm =(System.Web.UI.HtmlControls.HtmlForm)this.FindControl("DoDirPay"); frm.Attributes.Add("onSubmit","PayButton.disabled = true;");
Presumably all you professionals must solve this problem twenty times a day. So what's the best approach?
Ta.
Comment