Triggering validation for single keys on an $each validation?
See original GitHub issueHow to trigger validation for a list of items? Here’s an example of validation declaration:
validations: {
request: {
currency: {
required
},
total_amount: {
required,
decimal,
},
cover_until: {
required,
},
invoices: {
$each: {
amount: { required, decimal },
vat: { required },
issued_at: { required },
due_at: { required }
}
}
}
},
Now when I want to trigger the validation for invoices, I presume I would do something like this:
this.$v.request.invoices.$touch()
What about when I want to validate only the issued_at
key of a single invoice? How would that look like?
Thanks
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
How to trigger Form Validators in Angular2 - Stack Overflow
The Validator on P will look at the model to determine the state of X and will validate P accordingly. Here's some code:...
Read more >Angular Reactive Forms: trigger validation on submit
Validating all fields on submit ... To validate all form fields, we need to iterate throughout all form controls: Object.keys(this.form.controls).
Read more >trigger validateKey - Rocket Software
The validateKey trigger defines the procedural checks that are done to validate a modified primary or candidate key. Validation is performed only if...
Read more >Input Validation - OWASP Cheat Sheet Series
Input validation is performed to ensure only properly formed data is entering the workflow in an information system, preventing malformed data from persisting ......
Read more >Constraint validation - HTML: HyperText Markup Language
By choosing the most semantically appropriate value for the type attribute of the <input> element, e.g., choosing the email type automatically ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Sorry, there isnt. That’s the drawback of this helper.
There should be a way to not introduce another component.
const state = reactive( { translations: [{id: 1, title: ‘Sample title’, description: ‘Sample description’}] } )
const rules={ translations: { $each: helpers.forEach({ title: { required, }, description: { required, }, }), }, } useVuelidate(rules as any, voucher, { $lazy: true });
i can trigget v$.translations.$touch, but it will trigger both title and description