Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
I'd like to show errors after input on blur event, and a summary of all events on top of the form on submit.
Is it possible to do this and, if not, do you consider this could be planned for future release ?
Comments
Comment #1
attiks CreditAttribution: attiks commentedYou can always define a custom javascript callback and use the code to place the error messages where you want.
Comment #2
MarcElbichon CreditAttribution: MarcElbichon commentedyes, but how to know which event is triggered and hwn can i call standard placement ?
Comment #3
attiks CreditAttribution: attiks commentedOption 1
You can listen to clientsideValidationFormHasErrors to detect the submit, it passes the form, see http://drupalcode.org/project/clientside_validation.git/blob/refs/heads/...
If you need the validator as well, you probably have to patch line http://drupalcode.org/project/clientside_validation.git/blob/refs/heads/... and pass the validator
If you have to validator you can call validator.errorMap, it wil give you a list of all errors.
Option 2
Inside your custom callback you can do something like
error.appendTo(element);
error.appenTo($('#my-error-list'))
But you'll need a way to remove an error message after the input is valid
Comment #4
MarcElbichon CreditAttribution: MarcElbichon commentedOK, will try your solutions.
Many thanks for your help.