<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<script src="./jquery.min.js"></script>
<script>
function show() {
var Inputs = $('#extable').find("input"); //找到id是extable下所有的input标签 是jquery对象
console.log(Inputs.length);
for (var i = 0; i < Inputs.length; i++) { //遍历input标签
var ishas = Inputs[i].getAttribute('data-isRequired'); //拿到input标签里面的自定义属性
console.log(ishas);
if (ishas == "true") { //比对是不是有自定义属性的那个input标签
console.log("第" + i + "有");
var textValue = $(Inputs[i]).val().trim(); //jQuery对象[i] 就变成了dom对象,需要通过$(dom)转为jquery对象 使用val方法获取input输入的值
console.log(textValue);
}
}
}
</script>
<body>
<form action="https://www.baidu.com" method="GET">
<tr id="extendFieldTr">
<td><span class="titlenamespan">扩展字段</span></td>
<td colspan=2>
<table id="extable" border=0 cellpadding=0 cellspacing=2 style="margin-left:-2px">
<tr>
<td class=listCaption nowrap>
<div class='ueexftdtitle' title="会议日期">会议日期</div>
</td>
<td width=171 style='width:171px' nowrap>
<input type=text readonly name='mettingdate' class='input_css' style='width:170px;' value=''
onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})">
</td>
<td class=listCaption nowrap>
<div class='ueexftdtitle' title="开始时间">开始时间</div>
</td>
<td width=171 nowrap>
<input type=text readonly name='mettingsdate' class='input_css' style='width:170px;'
value='' onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})">
</td>
</tr>
<tr>
<td class=listCaption nowrap>
<div class='ueexftdtitle' title="结束时间">结束时间</div>
</td>
<td width=171 style='width:171px' nowrap>
<input type=text readonly name='mettingedate' class='input_css' style='width:170px;'
value='' onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})">
</td>
<td class=listCaption nowrap>
<div class='ueexftdtitle' title="名称">
<font color="ff6600">*</font>名称
</div>
</td>
<td width=171 nowrap>
<input type=text name='nameinfo' class='input_css' style='width:170px;' value=''
maxlength='200' data-isRequired="true">
</td>
</tr>
<tr>
<td class=listCaption nowrap>
<div class='ueexftdtitle' title="主讲人">主讲人</div>
</td>
<td width=171 style='width:171px' nowrap>
<input type=text name='zcr' class='input_css' data-isRequired="true" style='width:170px;' value=''>
</td>
<td class=listCaption nowrap>
<div class='ueexftdtitle' title="对象">对象</div>
</td>
<td width=171 nowrap>
<input type=text name='dx' class='input_css' style='width:170px;' value=''>
</td>
</tr>
<tr>
<td class=listCaption nowrap>
<div class='ueexftdtitle' title="地点">地点</div>
</td>
<td width=171 style='width:171px' nowrap>
<input type=text name='localinfo' class='input_css' style='width:170px;' value=''>
</td>
<td class=listCaption nowrap>
<div class='ueexftdtitle' title="备注">备注</div>
</td>
<td width=171 nowrap>
<input type=text name='bz' class='input_css' style='width:170px;' value=''>
</td>
</tr>
</table>
</td>
</tr>
</form>
<input type="button" onclick="show()">提交
</body>
</html>