asp.net mvc - Disable button with JQuery -


I'm peating my head with this and it sounds pretty easy, but I do not think so. The story is working with NopCommerce which is an ASP.NET MVC application and what I am trying to do, is that the user is going through the checkout process and they are on the shipping page, I want I want users to click on the "Continue" button. The Save method is called on the click event, I want to open a dialog box and give it some information. Then on the dialog box, they choose Yes / No and depending on their selection, either update their records depending on them, or if they choose yes and continue as if the button has the original Or if they do not click the box will not be done again, the button will do the job as it was originally clicked to go to the next section.

So this is just the HTML that looks like:

  & lt; / Li & gt; & Lt; Li id = "opc-shipping" category = "tab-section" & gt; & Lt; Div class = "step-title" & gt; & Lt; Span class = "number"> gt; 2 & lt; / Span & gt; & Lt; H2 & gt; Shipping address & lt; / H2 & gt; & Lt; / Div & gt; & Lt; Div id = "checkout-phase-shipping" category = "step one-item" style = "display: none;" & Gt; & Lt; Form action = "id =" co-shipping-form "> gt; id id =" checkout-shipping-load "> 
& lt ; ($ ("$ Shipping"); script type = "text / javascript" & gt; shipping indit ('#cSharing-form', 'http: // localhost: 15536 ​​/ checkout / opsweeping /'); Select the address "). Length & gt; 0) {shipping.needress (! $ ('# Shipping-address-select'). Val ());} & lt; / script & gt; & lt; div Class = "button" id = "shipping-button-container" & gt; & lt; p class = "back-link" & gt; & lt; a href = "#" onclick = "Checkout.back (); Return false; "> gt; & amp; laquo; & lt; / small> back & lt; span id = "Shipping-please-wait" class = "please-wait" style = "display: none;" & gt; loading the next stage ... & lt; / span & gt; & lt; / div & gt; ;

I have tried a lot of things but this is my last attempt:

 ('Click', '$' ('# shipping-buttons-container'). Always click (.) {Var me = $ (this); me.offtmp ('click'); // Ajax Request Disables the click event temporarily // $. Post (...). Always (function () {/ / Me.ontmp ('click'); // Ajax request is ready, we can now enable the click again}};});  

Even just pop Any suggestion that this does not work to try to get a warning up to?

You will not be able to disable click event "temporarily" Area fishing or not. So, kill it but, please keep in mind the earlier versions of IE that do not do this as a browser regularly. Do this at the top of your click function:

  if (e.preventDefault) {// e.preventDefault () for modern browsers; } Else {// for the old IE browser e.returnValue = false; }  

You are now free to display your message box / alerts so that user input is possible. If they say "no" / "cancel", just close the box if they accept it, close the box and call on a script so that the user is sent to the next section. (It looks like you are not using a form, but it will be $ ('# formID'). Submit (); .

Just do not enter back In the click function again.


Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -