$("#calculate").click(function(){ var within_number = $('#within_number').val(); var standard_deviation = $('#standard_deviation').val(); var k = (within_number * 1.0)/standard_deviation; var calculation = (1 - (1 * 1.0)/ (k * k))*100; $('#result').html('Percentage = ' + calculation.toFixed(2) + '%'); }); $("input").change(function(){ var isInvalid = $('#wDiv').hasClass('is-invalid') || $('#sDiv').hasClass('is-invalid'); if(isInvalid){ $("#calculate").prop("disabled", true); }else{ $("#calculate").removeAttr('disabled'); } });
Number required!
Number required!