I have form with few fields and a dynamic table (ID- installments with "Add new Row" button. Entire form has submit button. I want to disable the submit button if the dynamic table has no row. And, if that table has a content (By click on Add New Row button) then submit button will be again active.
I have searched a lot and found below code :
<script>$(document).ready(function(){
var rowCount = $('#installments tbody tr').length;
if(rowCount < 1){
$('#submit').attr('disabled','disabled');
} else {
$('#submit').removeAttr('disabled');
}
});</script>
The submit button is disabled on page load (As there are no records found in dynamic table). I want to activate the submit button when records are added .
Please assist. Thanks in advance.