0
我有以下表結構。如果用戶爲Ist安裝付費,則複選框將被禁用。現在我想要jquery驗證來限制用戶點擊付款IIIrd分期付款而無需支付IInd分期付款。但用戶可以一次支付IInd安裝。它的基本優先級取決於Jquery檢查父行被點擊時的子行優先級
<script> src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js">
</script>
<script>
$('tr input:checkbox').click(function(e) {
var table = $(e.target).closest('table');
$('td input:checkbox', table).attr('checked', e.target.checked);
});
</script>
<html>
<button id="submitButton" type="submit" class="btn btn-secondary">Cick To Pay</button>
<table>
<tr>
<td class="checkbox-column">
<input type="checkbox" name="invoices[]" id="tr_14640" class="icheck-input"/>
</td>
<td>IIInd Instalment</td>
<td><button type="button" class="btn btn-primary">UnPaid</button></td>
</tr>
<tr>
<td class="checkbox-column">
<input type="checkbox" name="invoices[]" id="tr_14640" class="icheck-input"/>
</td>
<td>IInd Instalment</td>
<td><button type="button" class="btn btn-primary">UnPaid</button></td>
</tr>
<tr>
<td class="checkbox-column">
<input type="checkbox" name="invoices[]" class="icheck-input" disabled />
</td>
<td>Ist Instalment</td>
<td><button type="button" class="btn btn-success">Paid</button>
</td>
</tr>
</table>
</html>
感謝。
你可以添加你嘗試過什麼JS/jQuery代碼? –