Closed vlascik closed 8 years ago
That would be pretty useful. Could add something along the lines of:
var form = document.getElementById('my-form');
var btn = document.getElementById('submit-btn');
form.addEventListener('dominarValidatedField', function(passed, field, dominar) {
if (dominar.isPassing())
{
btn.removeAttribute('disabled');
}
else
{
btn.setAttribute('disabled', 'disabled');
}
});
Sounds good, would dominar.isPassing() mean all fields on a form passing? Would field also have isPassing()?
Yes, dominar.isPassing() means are all fields passing and the actual result
of the field is passes
as supplied in the closure. Or could add
field.isPasing()
as well
On 7 December 2015 at 14:58, vlascik notifications@github.com wrote:
Sounds good, would dominar.isPassing() mean all fields on a form passing? Would field also have isPassing()?
— Reply to this email directly or view it on GitHub https://github.com/garygreen/dominar/issues/25#issuecomment-162548463.
Ok, great, thanks.
Closing this in favour of #26
I think it would be helpful if dominar would also have something like dominarValidationPassed / dominarValidationFailed events even without submitting the form, so that users could e.g. disable action buttons if the validation didn't pass. Or maybe this could be achieved in some other way?