怎么取到复选框对应的文本框
效果图是这样的:
如果文本框对应的复选框打勾了,则文本框必须输入数据,在提交时提示文本框不能为空。代码是先循环出行,单元格里再且套循环。怎么判断是哪个复选框打勾了?怎么取到对应的文本框?
代码如下:
<table>
<s:iteratorvalue="listSampleTask"status="status">
<tr>
<td>
<s:propertyvalue="strTaskName"default="--"/><spanstyle="color:red">(<s:propertyvalue="intSampleBatchNumber"/>次 剩余:<s:propertyvalue="intSampleBatchNumber-intSyNumber"/>次)</span>
</td>
<td>
<s:iteratorvalue="listSampleTaskConfig"status="status">
<inputtype="checkbox"name="check"value="<s:propertyvalue='lngTaskSid'/>-<s:propertyvalue='strClassDicCode'/>"/>
<s:propertyvalue="objSampleBreedClass.strDicName"/>
<spanstyle="color:red">(<s:propertyvalue="intSampleBatchNumber"/>次 剩余:<s:propertyvalue="intSampleBatchNumber-intDoneNumber"/>次)</span>
抽样数量:<inputtype="text"name="cysl"value="<s:propertyvalue='cyNumber'/>"maxlength="50">
</s:iterator>
</td>
</tr>
</s:iterator>
</table>
------解决思路----------------------
引用: