function check_mobile() { var appl_ev,mob,begin_pos,end_pos,monery_sum appl_ev=form_add.sqsy.value; if(appl_ev.indexOf("收款人手机号码:")!=-1) { begin_pos=appl_ev.indexOf("收款人手机号码:")+"收款人手机号码:".length; end_pos=appl_ev.indexOf("\n",begin_pos)-1; mob=appl_ev.substring(begin_pos,end_pos); if(begin_pos==end_pos) { if(confirm("系统检测到你没有输入\"收款人手机号码:\"项.\n是否确定要自行通知")) return true; else return false; } if(mob.length!=11) { alert("你现在输入的收款人手机号码不是11位的数字,\n请测查你的输入是否有误."); return false; } if(mob.indexOf("1")>0 ¦ ¦ mob.indexOf("1")==-1) { alert("收款人手机号码格式不正确!"+mob.substring(1,2)); return false; } if(isNaN(mob)) { alert("收款人手机号码格式不为11位数字,请检查!"); return false; } if(appl_ev.indexOf("汇款金额:")==-1) { alert("系统不能找到\"汇款金额:\"\n请不要修改申请模板"); return false; } //验证汇款金额 begin_pos=appl_ev.indexOf("汇款金额:")+"汇款金额:".length; end_pos=appl_ev.indexOf("\n",begin_pos)-1 if(begin_pos==end_pos) { alert("你没有输入\"汇款金额:\""); return false; } else monery_sum=appl_ev.substring(begin_pos,end_pos); if(isNaN(monery_sum)) { alert("\"汇款金额:\"后面只能填写数字"); return false; } return true; } else { if(confirm('系统在申请事由内没有找到\"收款人手机号码:\"项\n是否确定自行通知客户。')) return true; else return false; } } <form name="form_add" id="form_add" method="post" onsumbit="return check_mobile()"> <td class="InputAreaCell" colspan="3"> <textarea class="inputarea" name="sqsy" cols="75" rows="12" style="width:100%;">汇款金额: 收款人: 开户银行: 账号: 申请部门: 付款用途: 其它说明: 冲账方式(冲TIS、收入或预提): 收款人手机号码: </textarea> </form> |