Sunday, 15 June 2014

jquery - show a modal dialog and stop all others event -



jquery - show a modal dialog and stop all others event -

i trying open modal dialog when visitor take cape cod local van delivery $1.00

<select name="shippingspeedchoice" onchange="this.form.submit();" style=""> <option value="0">please select</option> <option value='101' >free shipping (ups ground) </option> <option value='1001'>cape cod local van delivery $1.00 </option> </select>

my script :

$("#v65-cart-shipping-details select").change(function(event) { if (this.value == '1001'){ $("#dialog-modal").dialog({ height: 140, modal: true }); } });

the modoal show few secondes , soudanly page reload due onchange="this.form.submit();"

i need stop event until close modal dialog

remove onchange event html

<select name="shippingspeedchoice" style=""> <option value="0">please select</option> <option value='101' >free shipping (ups ground) </option> <option value='1001'>cape cod local van delivery $1.00 </option> </select>

and set jquery this:

$("#v65-cart-shipping-details select").change(function(event) { if (this.value == '1001'){ $("#dialog-modal").dialog({ height: 140, modal: true, close:function(){ // form submit action here } }); } });

jquery events

No comments:

Post a Comment