您好我已經開發了一個表格的輸入框值不應大於表格外的輸入框。輸入框的值不應大於表格的外部輸入框
<form>
<div class="form-group">
<label class="label1 col-md-4">Total number of sanctioned seats
<span class="required"> * </span>
</label>
\t \t \t \t \t \t \t <div class="col-md-7">
<input type="text" class="form-control" id="sanctionedSeatsSummary">
</div>
\t \t \t \t \t \t </div>
\t \t \t \t \t \t
\t \t \t \t \t \t <table class="eduleveles table table-bordered table-hover">
\t \t \t \t \t \t \t \t
<thead>
<th></th>
<th>Faculty</th>
\t \t <th>Enter sanctioned seats</th>
</thead>
<tbody>
<tr>
<td>
<input type="checkbox" name="Check" class="cbxenable">
</td>
<td>
</td>
\t \t \t <td>
<input type="text" class="form-control seats" name="seats">
</td>
</tr>
<tr>
<td>
<input type="checkbox" name="Check" class="cbxenable">
</td>
<td>
</td>
\t \t \t <td>
<input type="text" class="form-control seats" name="seats">
</td>
</tr>
<tr>
<td>
<input type="checkbox" name="Check" class="cbxenable">
</td>
<td>
</td>
\t \t \t <td>
<input type="text" class="form-control seats" name="seats">
</td>
</tr>
</tbody>
</table>
</form>
以上的jsfiddle所有ENTER批准的席位總和不會更大的onchange則 「輸入的批准席位總數」。
您可以使用jquery的onkeyup事件來驗證您的結果。當我在填寫完所有已批准的席位後更改總數時會發生什麼? –
你能幫我一些工作小提琴嗎? –
是我創造小提琴。 –