失去焦点事件 blur()

本文介绍了一个JavaScript函数,该函数在用户输入指定字段时会检查是否包含“FBA”或“Amazon”等敏感词汇,并在特定国家与运输方式组合下弹出警告对话框。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

function RestrictionWords() {
     $(".blur").blur(function () {
          var consignee_country_id = $("[name=consignee_country_id] option:selected").val();
          var shipping_method = $("[name=shipping_method] option:selected").val();
          var consignee_first_name = $("[name=consignee_first_name]").val();
          var consignee_last_name = $("[name=consignee_last_name]").val();
          var consignee_company = $("[name=consignee_company]").val();
          var consignee_address1 = $("[name=consignee_address1]").val();
          var consignee_address2 = $("[name=consignee_address2]").val();
          if (((/FBA/i).test(consignee_first_name)) ||
                  ((/Amazon/i).test(consignee_first_name)) ||
                  ((/FBA/i).test(consignee_last_name)) ||
                  ((/Amazon/i).test(consignee_last_name)) ||
                  ((/FBA/i).test(consignee_company)) ||
                  ((/Amazon/i).test(consignee_company)) ||
                  ((/FBA/i).test(consignee_address1)) ||
                  ((/Amazon/i).test(consignee_address1)) ||
                  ((/FBA/i).test(consignee_address2)) ||
                  ((/Amazon/i).test(consignee_address2))) {
               if ((consignee_country_id == 115 && shipping_method == 'SFCQMITR') || (consignee_country_id == 89 && shipping_method == 'SFCQMDER')) {
                    $("#messageDialog").html('<p><{t}>100002294<{/t}><p>').dialog("open");
               }
          }
     })
}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值