标签:class NPU false code ret form split val 序列化表单
<form id="form1"> <input type="text" value="1" name="Total" /> </form>
//判断序列化表单是否包含空值 var data = $("#form").serialize(); var array = data.split("&"); for (var i = 0; i < array.length; i++) { var kwarr = array[i].split("="); for (var j = 0; j < kwarr.length; j++) { if (kwarr[j] == null || kwarr[j] == ‘‘) { alert("请把必填信息填上") return false; } } }
标签:class NPU false code ret form split val 序列化表单
原文地址:https://www.cnblogs.com/zpblogs/p/14704725.html