jquery 必填项判断表单是否为空的方法
来源:互联网 发布:网络交易平台那些好 编辑:程序博客网 时间:2024/05/20 17:26
<form onsubmit="if(confirm('确定好你所填写的正确,不然会发错!')) {return checkForm();}else{return false;}" >
<table >
<tr>
<td>选择发送人<font class="red">*</font></td>
<td>
<input type="text" name="sendto_type[]" id="sendto_type1" value="1" >按城市发送
</td>
</tr>
<tr>
<td>选择发送人2<font class="red">*</font></td>
<td>
<input type="text" name="sendto_type[]" id="sendto_type1" value="1" >按城市发送
</td>
</tr>
</table>
</form>
js代码
<script>
function checkForm() {
pass = true;
$("td:contains('*')").next().find("input").each(function(){
if(this.value == '') {
text = $(this).parent().prev().text();
alert(text+"是必填项");
this.focus();
pass = false;
return false;//跳出each
}
});
return pass;
}
</script>
- jquery 必填项判断表单是否为空的方法
- JQuery mobile textarea 判断是否为空的方法
- jQuery的isEmptyObject方法判断对象是否为空
- JQuery判断是否为空
- JQuery判断是否为空
- 判断字符串是否为空的方法
- 判断字符串是否为空的方法
- 判断是否为空的一些方法
- 判断字符串是否为空的方法
- js判断提交的表单是否为空
- jquery 判断对象是否为空,判断后台传回来的data数据是否为空
- JS判断表单输入是否为空
- JS判断表单输入是否为空
- js判断表单提交是否为空
- js判断表单输入是否为空
- JS判断input表单是否为空
- ios判断字符是否为空字符的判断方法
- Jquery 判断对象类型的值是否为空
- Windows下编译ffmpeg
- 为了积分发帖
- 多维数组遍历方法
- OLE DB
- C语言头文件&预处理器&二进制位操作符
- jquery 必填项判断表单是否为空的方法
- ARM学习笔记(八)--寻址方式
- 联想ThinkPad SL410(28428KC)与2842-EWC区别
- 某触摸屏程序登录界面设计
- HDU 2469 Fire-control System解题报告
- 软考--计算机组成和体系结构
- 字节对齐问题
- 交叉编译工具链 V110929.02
- ARM学习笔记(九)--指令基本格式