Hello,
I have some forms on my website that require all the fields to be filled in. I want to make the submit button active only when all required fields are filled in till then the submit button should remain greyed out.
I tried but could not succeed. Would the forum help please ?
Thanks
Ron
I have some forms on my website that require all the fields to be filled in. I want to make the submit button active only when all required fields are filled in till then the submit button should remain greyed out.
I tried but could not succeed. Would the forum help please ?
Thanks
Ron
Hi Ron,
Is this ChronoForms v4? Are are all the inputs text inputs or are there other types as well?
Bob
Is this ChronoForms v4? Are are all the inputs text inputs or are there other types as well?
Bob
Hi Ron,
If you have a class='required' to identify the required inputs then something like this should work:
Bob
If you have a class='required' to identify the required inputs then something like this should work:
window.addEvent('domready', function() {
$('submit').disabled = true;
var req = $$('form#form_id input.required');
req.each(function(item){
item.addEvent('keyup', allowSubmit);
});
function allowSubmit() {
var submit = req.every(function(item) {
item.value != '';
});
if ( submit ) {
$('submit').disabled = false;
} else {
$('submit').disabled = true;
}
}
});
ot tested and will need debugging!Bob
This topic is locked and no more replies can be posted.