I have 5 input fields 3 are select and 2 are input type and 1 submit button. i want to enable the submit button when all the fields have value in it. If any of the value is missing button should go disable again like & condition
following is my code
<select class='form-control class-manufacturer' name="" id='id_manufacturer>
<option value="" selected disabled>Manufacturer *</option>
<option value="">Apple</option>
<option value="">Samsung</option>
</select>
<select class='form-control class-modelName' name="" id='id_modelName">
<option value="" selected disabled>Model *</option>
<option value="" >Iphone</option>
<option value="" >Note</option>
</select>
<select class='form-control class-partName' name="" id='id_partName' >
<option value="" selected disabled>Part *</option>
<option value="" >IC</option>
<option value="">LED</option>
</select>
<input type="text" name='' id="id_quantity" class="form-control class-quantity" pattern="^[0-9]{1,}$" maxlength="11" placeholder="Quantity *"/>
<input type="text" name='' id="id_costPerUnit" class="form-control class-costPerUnit" pattern="^[0-9]{1,}$" maxlength="11" placeholder="Price *"/>
<button type="button" class="btn btn-default add-row a" onclick="add()" disabled='disabled' style="padding:10px 65px;">Add</button>
I want to enable and disable the addrow button if all the fields have values using jquery
what i have tried
<!--add button disable enable function-->
$(function(){
var i;
$('.class-manufacturer').change(function(){
$('.class-modelName').change(function() {
$('.class-partName').change(function(){
$('.class-quantity').keypress(function() {
$('.class-costPerUnit').keypress(function(){
$('.add-row').prop('disabled', false);
}); }); }); }); });
});