表单第一次提交后再提交js验证错误还可以提交上次的内容 本地是好的 在另一台机子触发这个错误
<form method="post" action="doinsert.php" onsubmit="return validator(this)" name="form">
<table class="mzdengji">
<caption>
上海健桥医院口腔科门诊信息添加
</caption>
<tr>
<th scope="col">日期</th>
<th scope="col">姓名</th>
<th scope="col">年龄</th>
<th scope="col">性别</th>
<th scope="col">电话</th>
<th scope="col">初/复诊</th>
<th scope="col">治疗项目</th>
<th scope="col">上月</th>
<th scope="col">本月</th>
<th scope="col">实收</th>
<th scope="col">院1</th>
<th scope="col">院2</th>
<th scope="col">欠费</th>
<th scope="col">医生</th>
<th scope="col">途径</th>
</tr>
<tr>
<td><input name="date" type="text" id="date" tabindex="1" onfocus="setday(this)" size="6" errmsg="请填写日期" valid="required" /></td>
<td><input name="name" type="text" id="name" maxlength="4" tabindex="1" size="6" errmsg="请填写患者姓名" valid="required" onkeyup="value=value.replace(/[^\u4E00-\u9FA5]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\u4E00-\u9FA5]/g,''))" /></td>
<td><input name="age" type="text" id="age" maxlength="2" tabindex="1" size="3" onkeyup="value=value.replace(/[^\d]/g,'') " onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))" /></td>
<td>
<select name="sex" id="sex">
<option value="1">男</option>
<option value="2">女</option>
</select>
</td>
<td><input type="text" name="tel" id="tel" tabindex="1" size="8" maxlength="14" errmsg="请填写电话" valid="required" onkeyup="value=value.replace(/[^\d]/g,'') " onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))" /></td>
<td><select name="fuzhen" id="fuzhen">
<option value="1" style=" background-color:#6C0; color:#FFF">初诊</option>
<option value="2" style="background-color:#F30; color:#FFF">复诊</option>
</select></td>
<td><select name="xiangmu" id="xiangmu" >
<option value="1">洗牙</option>
<option value="2">拔牙</option>
<option value="3">补牙</option>
<option value="4">种植牙</option>
<option value="5">牙齿美白</option>
<option value="6">牙齿矫正</option>
</select></td>
<td><input name="shangyue" type="text" id="shangyue" tabindex="1" size="3" maxlength="6" onkeyup="value=value.replace(/[^\d]/g,'') " onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))" /></td>
<td><input name="benyue" type="text" id="benyue" tabindex="1" size="3" maxlength="6" onkeyup="value=value.replace(/[^\d]/g,'') " onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))" /></td>
<td><input name="shishou" type="text" id="shishou" tabindex="1" size="3" maxlength="6" onkeyup="value=value.replace(/[^\d]/g,'') " onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))" /></td>
<td><input name="yuan1" type="text" id="yuan1" tabindex="1" size="3" onkeyup="value=value.replace(/[^\d]/g,'') " onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))" maxlength="6"/></td>
<td><input name="yuan2" type="text" id="yuan2" tabindex="1" size="3" onkeyup="value=value.replace(/[^\d]/g,'') " onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))" maxlength="6"/></td>
<td><input name="qianfei" type="text" id="qianfei" tabindex="1" size="3" onkeyup="value=value.replace(/[^\d]/g,'') " onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))" maxlength="6"/></td>
<td><label>
<select name="yisheng" id="yisheng">
<option value="1">占建华</option>
<option value="2">梁振</option>
<option value="3">计春英</option>
<option value="4">侥行</option>
</select>
</label></td>
<td>
<select name="tujing" id="tujing" >
<option value="1">网络</option>
<option value="2">门诊</option>
<option value="3">朋友</option>
</select></td>
</tr>
<tr>
</tr>
<tr>
<td>
<input type="submit" name="tijiao" id="tijiao" class="button" value="提交" />
<input type="reset" name="chongzhi" id="chongzhi" class="button" value="重置" />
</td>
</tr>
</table>
</form>