html:

名称1:<input class="seasoning_name" type="text" name="seasoning_name[]">
名称2:<input class="seasoning_name" type="text" name="seasoning_name[]">
名称3:<input class="seasoning_name" type="text" name="seasoning_name[]">

js:

seasoning_name = "";
$('.seasoning_name').each(function(){ seasoning_name += $(this).val();
}) if(seasoning_name == ""){ alert("至少填写一项配料!");
return false;
}

jQuery 判断表单中多个 input text 中至少有一个不为空的更多相关文章

  1. jQuery 判断多个 input checkbox 中至少有一个勾选

    html ( 使用 TP 标签 ) : <volist name="health_tag" id="htag"> <input type=&q ...

  2. jquery验证表单中的单选与多选

    jquery验证表单中的单选与多选 这里所说的,用jquery去验证某一组多选至少要有一个选中,某一组单选至少有一个选中,,大家都知道单一的一个用js比较好验证,但是想要用jquery的验证并且用到j ...

  3. JS如何判断表单中用户选择哪个哪个选项?

    JS如何判断表单中用户选择哪个哪个选项? HTML代码: <form name="form1" onsubmit="return foo();"> ...

  4. jquery判断表单内容是否为空

    //判断表单数据是否为空 var t = $('form').serializeArray(); $.each(t,function(i,item){ if(item['value'] == '') ...

  5. jQuery判断表单input

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  6. jquery判断表单提交是否为空

    <input type="text" value="" name="toPage"> 判断该表单是否为空 var p = $(& ...

  7. 【js】批量判断表单中的文本框非空

    方法一: <script type=”text/javascript”> /* * 批量验证表单非空 * 需要非空验证控件的样式class=”mustadd” */ $(".mu ...

  8. 判断表单中是否含有disabled属性

    我想判断input里面是否有disabled.或者选中未选中的selected  checked 属性时,需要用  prop()  方法,返回的结果是 true 或 false . attr()这个方 ...

  9. jquery获取表单中的数据

               <form>                 <input name="username" type="text"/&g ...

随机推荐

  1. Entity Framework 使用

    1.EF中Include方法的使用使用Include方法,告诉EF连接查询哪个外键属性,生成Inner join连接 //必须引用using System.Data.Entity;才能用Include ...

  2. jquery 展开折叠菜单

    jquery 展开折叠菜单 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <ht ...

  3. IntelliJ下使用Code/Live Template加快编码速度:程序员的工作不是写程序,而是写程序解决问题

    程序员的工作不是写程序,而是写程序解决问题. --- 某不知名程序员 我们每天都在写代码,有些代码有结构性的相似,但不是所有的代码都可以被抽成方法.在这种情况下,我们应该考虑使用template的方式 ...

  4. php操作数据库找不到列

  5. Loadrunner中web_custom_request使用场景

    其中有一段从服务器段动态返回的字符串需要重新提交给服务器(见红色标注) 录制自动生成的脚本是: web_submit_data("generateYfLstAction.do",  ...

  6. mvc-3模型和数据(2)

    寻址引用 源代码现存的问题:当保存或通过find()查找记录时,所返回的实例并没有复制一份,因此对任何属性的修改都会影响原始资源:这里我们只想当调用update()方法时才会修改资源 //由于Mode ...

  7. 看病要排队(stl)

    Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission( ...

  8. topcoder SRM 593 DIV2 WolfDelaymaster

    #include <iostream> #include <string> #include <algorithm> using namespace std; cl ...

  9. 【BZOJ】1603: [Usaco2008 Oct]打谷机(水题+dfs)

    http://www.lydsy.com/JudgeOnline/problem.php?id=1603 这种水题... dfs没话说.. #include <cstdio> #inclu ...

  10. HDU 4057 Rescue the Rabbit(AC自动机+DP)

    题目链接 一个数组开小了一点点,一直提示wa,郁闷,这题比上个题简单一点. #include <iostream> #include <cstring> #include &l ...