Pass an object to custom validation
See original GitHub issueVersions:
- VueJs: #.#.#
- Vee-Validate:
Description:
Hello logaretm, So firstly i want to thank you for you incredible repository, I’m using vuetify with vee-validate, I confess that you have the best vuejs validation library in all the web, It is complete with an incredible documentation. I have a question : There is a way to passe an object to custom validation, because I create my inputs fields with a loop and each input contains an object
For example
<p v-for="inventory in List">
<v-text-field
:label="'Stock ('+inventory.currentStock+' '+inventory.type+')'"
:name="inventory.nameStock"
v-model="inventory.stock"
v-bind:rules="inventory.rulesStock"
v-validate="'required|custom_valid'"
></v-text-field>
</p>
There is for example a directive like : v-pass-args-to-custom-validation=“inventory”? Or something that can help me in my case? Thanks so much in advance.
Steps To Reproduce:
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Passing Objects to Custom Validator in WTForms
Here is the custom validator that works when the user is editing their own account from a different form class: # Custom validation...
Read more >Custom Rules - VeeValidate
You can recieve an object instead of an array for your validation rule by providing a paramNames array in the extend options (third...
Read more >Part #3 - Rule Objects Custom Laravel Validation - YouTube
Adding custom validation using the rule object is an alternative to using ` Validator ::extend`. By using Rule Objects you can make creating ......
Read more >Validation - Laravel - The PHP Framework For Web Artisans
Validating Nested Array Input; Error Message Indexes & Positions. Validating Files; Validating Passwords; Custom Validation Rules. Using Rule Objects; Using ...
Read more >Spring MVC Custom Validation - Baeldung
Creating a custom validator entails rolling out our own annotation and using it in our model to enforce the validation rules. So let's...
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
Thank you for the kind words 😄 . You can validate objects, if your input knows how to deal with them. for example I can’t see how the text field component would be able to deal with an object, eventually you are validating the object stock value which is a string/number.
anyways, you can create a custom rule that accepts said objects as params:
and in your html you can use the object form:
Can I validate a pdf file using vee-validate?