JS 判断特殊字符

来源:互联网 发布:赢时胜软件上海分公司 编辑:程序博客网 时间:2024/06/10 01:09
 var orderCode=$("#orderCode").val();       var scheduledProducedUnits=$("#scheduledProducedUnits").val();              var str=/^[^@\/\'\\\"#$%&\^\*]+$/;                    if(isNaN(scheduledProducedUnits)){      new PNotify({               text: '计划生产数量必须是数字',               type: 'error',               styling: 'bootstrap3'           });  return false;       }else if(orderCode==""){      new PNotify({               text: '订单编号不能为空',               type: 'error',               styling: 'bootstrap3'           });  return false;          }else if(/[@\/'\\"#$%&--\^*]/.test(orderCode)){      new PNotify({               text: '订单编号包含敏感字符',               type: 'error',               styling: 'bootstrap3'           });  return false;

0 1
原创粉丝点击