当访客选择 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>
我的剧本:
$("#v65-cart-shipping-details select").change(function(event) {
if (this.value == '1001'){
$("#dialog-modal").dialog({
height: 140,
modal: true
});
}
});
由于onchange="this.form.submit();"
我需要停止此事件,直到我关闭模态对话框
答案 0 :(得分:0)
从HTML中删除onchange事件
<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>
并像这样放置jQuery:
$("#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
}
});
}
});