You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I cannot find any documentation pertaining to looping through all errors for a given field. The documentation seems to imply that you must know all the validations, and every field, and then write a new conditional block for each. This is amazingly inefficient and results in some fairly ugly code.
Describe the solution you'd like
Make it so that we can simply check if a form is invalid for each block, and if so, loop through all errors (if applicable) for a given field. This will ensure we do not have to check for each individual validation requirement for that field.
Ideally, the API would look something like the following:
#if ($myForm.hasErrors('field'))
// loop through error and output messages
/if
Introducing a set of language files for supporting various messages would make this idea a reality and considering all fields' errors would look fairly similar across all apps, imho shoudl be supported.
Additional context
A perfect example is "required". The message itself should be pretty much identical for ALL fields, yet we're having to define them for every field, then check for every field if the required validation has been broken. This results in fairly wet solutions (read: not DRY) which is more susceptible to bugs.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
I cannot find any documentation pertaining to looping through all errors for a given field. The documentation seems to imply that you must know all the validations, and every field, and then write a new conditional block for each. This is amazingly inefficient and results in some fairly ugly code.
Describe the solution you'd like
Make it so that we can simply check if a form is invalid for each block, and if so, loop through all errors (if applicable) for a given field. This will ensure we do not have to check for each individual validation requirement for that field.
Ideally, the API would look something like the following:
Introducing a set of language files for supporting various messages would make this idea a reality and considering all fields' errors would look fairly similar across all apps, imho shoudl be supported.
Additional context
A perfect example is "required". The message itself should be pretty much identical for ALL fields, yet we're having to define them for every field, then check for every field if the required validation has been broken. This results in fairly wet solutions (read: not DRY) which is more susceptible to bugs.
The text was updated successfully, but these errors were encountered: