Vee-validate: If we do not touch the form element and then we will submit that form , then required field also not throwing an error

Created on 19 Jan 2018  路  5Comments  路  Source: logaretm/vee-validate

#### Versions:

  • VueJs: ^2.3.3
  • Vee-Validate: ^2.0.0-rc.6

### Description:
When i do not touch the form that time even we have required input, still form does not through an error , but if i will touch that input and then submitting the form then that element validation working ,
how can i handle this situation.

Steps To Reproduce:

https://jsfiddle.net/singhalpiyush1993/h4a6zxgy/
In the following JSFiddle
1>at first just do focus on input, and leave this input blank and then submit that form , that is working fine
2>now run that fiddle again then do not focus on input directly submit this form , there should be error as this input is required, but it is not throwing any error

馃摎 docs 馃檹 help wanted

Most helpful comment

This should be labeled as bug. The .initial modifier is not suitable for this scenario.

All 5 comments

You can use .initial modifier to force the validation of the field initial value.
See example: http://vee-validate.logaretm.com/examples.html#initial-value

This should be labeled as bug. The .initial modifier is not suitable for this scenario.

That's not a bug, it's just a different scenario.
There's actually an example in the documentation for when you want to validate the form before submitting.
http://vee-validate.logaretm.com/examples.html#validate-form

Yes, this makes sense now. validateAll is a Promise, so your logic should be inside the then function.

I was using passive validation and obviously I was expecting VeeValidate to handle submitting before the user actually touches the form. I thought it was a bug, and started searching the issues. Never suspected this behavior would be intentional.

I don't know about the internals of the library, but I am confident when I say that this should be handled by default, and the controls should be inverted; i.e a prop to be provided whenever the opposite behavior is desired.

I know you might think this had been covered before already and not worth discussing, but I think this excellent library should not lack the important feature of being intuitive and well-organized.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Hoagiex picture Hoagiex  路  3Comments

saintplay picture saintplay  路  3Comments

MeltedFreddo picture MeltedFreddo  路  3Comments

MaxMilton picture MaxMilton  路  3Comments

yyyuuu777 picture yyyuuu777  路  3Comments