JS怎么实现必填项都填完以及填写格式都正确后再点击提交按钮弹出提交成功,否则提交失败,请重新填写 15
<formclass="yuyue_message"name="order"id="order"action=""method="post"onSubmit="retur...
<form class="yuyue_message" name="order" id="order" action="" method="post" onSubmit="return checkForm();">
<div class="xm">
<label for="name" class="label_label"><span style="color:#F00">*</span> 姓名:</label>
<input type="text" name="usrname" id="usrname" class="input_input" onSubmit="checkName();" placeholder="请输入正确姓名" maxlength="20" size="20" >
</div>
<div class="dlk1">
<label for="sex" class="label_label"><span style="color:#F00">*</span> 性别:</label>
<input type="radio" name="sex" id="sex" value="1" checked="checked" onSubmit="checkSex();" /> 男
<input type="radio" name="sex" id="sex" value="2" onSubmit="checkSex();" /> 女
</div>
<div class="dlk1">
<label for="age" class="label_label"><span style="color:#F00">*</span> 年龄:</label>
<input type="text" name="usrage" id="usrage" class="input_input" placeholder="请输入正确年龄" maxlength="3" onkeyup="value=value.replace(/[^\d]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))" onSubmit="checkAge();">
</div>
<div class="dlk2">
<label for="phone" class="label_label"><span style="color:#F00">*</span> 联系方式:</label>
<input type="tel" name="usrtel" id="usrtel" class="input_input" placeholder="请输入正确的联系方式" onSubmit="checkTel();" maxlength="12" size="12">
</div>
<div class="dlk3">
<label for="object" class="label_label"> 预约项目:</label>
<input type="text" name="object" class="input_input" value="近视手术" maxlength="4" disabled="disabled">
</div>
<div class="dlk3">
<label for="yytime" class="label_label"> 预约时间:</label>
<select name="time" id="time" class="input_input">
<option value="1">近一周</option>
<option value="2">近三个月</option>
<option value="3">三个月后</option>
</select>
</div>
<div class="dlk3">
<label for="decrpition" class="label_label1">详细描述:</label>
<textarea name="decrpition" id="decrpition" cols="55" rows="10"></textarea>
</div>
<div class="button3">
<input type="image" src="images/submit.png" id="submit" class="submit" value="提交" onclick="return checkForm();">
<input type="image" src="images/index.png" id="index" class="index" value="返回首页" onclick="">
</div>
</form> 展开
<div class="xm">
<label for="name" class="label_label"><span style="color:#F00">*</span> 姓名:</label>
<input type="text" name="usrname" id="usrname" class="input_input" onSubmit="checkName();" placeholder="请输入正确姓名" maxlength="20" size="20" >
</div>
<div class="dlk1">
<label for="sex" class="label_label"><span style="color:#F00">*</span> 性别:</label>
<input type="radio" name="sex" id="sex" value="1" checked="checked" onSubmit="checkSex();" /> 男
<input type="radio" name="sex" id="sex" value="2" onSubmit="checkSex();" /> 女
</div>
<div class="dlk1">
<label for="age" class="label_label"><span style="color:#F00">*</span> 年龄:</label>
<input type="text" name="usrage" id="usrage" class="input_input" placeholder="请输入正确年龄" maxlength="3" onkeyup="value=value.replace(/[^\d]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))" onSubmit="checkAge();">
</div>
<div class="dlk2">
<label for="phone" class="label_label"><span style="color:#F00">*</span> 联系方式:</label>
<input type="tel" name="usrtel" id="usrtel" class="input_input" placeholder="请输入正确的联系方式" onSubmit="checkTel();" maxlength="12" size="12">
</div>
<div class="dlk3">
<label for="object" class="label_label"> 预约项目:</label>
<input type="text" name="object" class="input_input" value="近视手术" maxlength="4" disabled="disabled">
</div>
<div class="dlk3">
<label for="yytime" class="label_label"> 预约时间:</label>
<select name="time" id="time" class="input_input">
<option value="1">近一周</option>
<option value="2">近三个月</option>
<option value="3">三个月后</option>
</select>
</div>
<div class="dlk3">
<label for="decrpition" class="label_label1">详细描述:</label>
<textarea name="decrpition" id="decrpition" cols="55" rows="10"></textarea>
</div>
<div class="button3">
<input type="image" src="images/submit.png" id="submit" class="submit" value="提交" onclick="return checkForm();">
<input type="image" src="images/index.png" id="index" class="index" value="返回首页" onclick="">
</div>
</form> 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询