-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Validation] - Make Identifier Optional #2579
Comments
I think this makes sense as an enhancement. Allow both |
+1 |
Identifiers are now optional. |
I've added a new form shorthand that works like this $('.ui.form')
.form({
fields: {
name : 'empty',
gender : 'empty',
username : 'empty',
password : ['minLength[6]', 'empty'],
skills : ['minCount[2]', 'empty'],
terms : 'checked'
}
})
; Will automatically expand out to full validation settings using default prompts and matching validation identifier against property. |
@jlukic, Thank you for your hard work |
😄 |
I was hoping to do that as well, but there are complications with how it's handled internally. |
Can one keep a copy of the "fields" object and alter "prompt" to change the actual error message displayed? Alternatively can "prompt" optionally be a function that returns the error message? |
It seems the shorthand version could not be used in conjunction with the full version for validation rules. It would be more reasonable to be flexible in these forms. |
Form validation code would be DRYer if we could omit specifying field
name
two times.Instead of:
I propose by default:
In case user needs to have differing fieldname and identifier name - he can explicitly specify
identifier
.The text was updated successfully, but these errors were encountered: