Was wondering if anyone could point me in the right direction with the following piece of jquery. I want to disable the submit button until my input fields have been filled in.
I have come up with this
$(document).ready(function (){
if ($('#inputName, #inputEmail, #inputTel').val().length > 0) {
$("input[type=submit]").attr("disabled", "false");
}
else {
$("input[type=submit]").attr("disabled", "true");
}
});
but the button is permanently disabled, Even after filling in all the text input fields
Still learning Jquery and haven't used it for a while.. So any pointers appreciated
Thanks
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…