一、只能为数字或字母: var az09 = /^[a-zA-Z0-9]*$/g; if(budgetNo.length>0 && !az09.test(budgetNo)){ alert("预算编号只能为字母或数字组合 !"); return; }