question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

requiredIf does not work in combination with other validaitons.

See original GitHub issue

I am having an issue with multiple validations included with a requiredIf validation.

faith: {
        requiredIf: requiredIf(() => {
          return this.ch_class == 'Paladin'|| this.ch_class == 'Druid'|| this.ch_class == 'Cleric'
        }),
        alpha,
        maxLength: maxLength(25)
      }

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:17 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
gibkigonzocommented, Nov 23, 2018

Implementation is not different. With validations() it just call validation object with vue component, so you can use this in your validations. You have only blank page? any errors?

2reactions
gibkigonzocommented, Nov 21, 2018

You need to use dynamic validations, then this will point to Vue instance, here are docs https://monterail.github.io/vuelidate/#sub-dynamic-validation-schema

Here is your example https://jsfiddle.net/b5v4faqf/7368/

Read more comments on GitHub >

github_iconTop Results From Across the Web

RequiredIf Conditional Validation for two variables in MVC4
I have a model class that is following
Read more >
Vuelidate | A Vue.js model validation library
Simple, lightweight model-based validation for Vue.js. ... Support for function composition; Validates different data sources: Vuex getters, computed values ...
Read more >
Required if validation in combination with In rule - Laracasts
How to write validation rules which is only required if some criteria are meet but in that case I need to validate is...
Read more >
The Complete Guide To Validation In ASP.NET MVC 3 - Part 2
This is second part our comprehensive guide to ASP.NET MVC 3 validation. In this article, we will write several custom validators by subclassing ......
Read more >
Model validation in ASP.NET Core MVC | Microsoft Learn
The [ClassicMovie] attribute is a custom validation attribute and the others are built in. Not shown is [ClassicMovieWithClientValidator] ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found