I have a form which has a few textboxes and they have text in them already filled from a SQL table.
I am using jQuery, to once all textboxes have at least 1 value inside them to enable the button (#edit).
On this form, due to the textboxes already been filled, the button should be automatically enabled, however I have to edit one of the textboxes first before it enables it.
$(function() {
$('.fields).change(function(){
if (($('#title').val().length > 0) && ($('#name).val().length > 0) && ($('#email').val().length > 0) && ($('#address).val().length > 0)) {
$('#edit').attr("disabled", false);
}
else {
$('#edit').attr("disabled", true);
}
});
});
Any ideas?
Thanks.