Quasar: QForm validate bug (or possibly new feature?)

Created on 12 May 2019  路  5Comments  路  Source: quasarframework/quasar

Hi all,
I need to show my users an empty form but with error on every non validated field, some kind of pre flight-validation. I found the validate method on QForm that probably can help me,but i notice it exits after showing first not validated field skipping all remaining fields.

as an example you can see
Here the QForm validation
Here what i need, with a custom function

the question/request is: is it right that validate function exits after first error or it should show/validate all other fields?

Most helpful comment

"Greedy" validation (as requested) will be available in v1.1.1 through the greedy prop.

All 5 comments

Hi,

This is for a) performance reasons and b) to make it as generic as possible because you could use async rules on a lot of QForm containing components which would make validation take "too long".

I think having at least the option to do a "deep" validation would be helpful. It helps me make sure that the form and the labels are in sync (plus easier integration testing). In addition, this is an easy way to highlight all required/improper fields for the user. Not sure what it would take to do this, but would you consider a PR that did this? Thanks.

This feels so weird, I would definitely opt for a "deep validation". From UX perspective, imagine a long form with lots of optional inputs but still few (hard to spot) required ones. It's usually much easier to fill in what you as user consider required and then let the submit button highlight all errors for you to fix contrary to be forced to press submit after each fix just move to next one (and damn if the form is long and submit at the bottom)...

@rstoenescu Reopen and maybe consider that PR from @rettigd, please?

@smajl I will consider it.

"Greedy" validation (as requested) will be available in v1.1.1 through the greedy prop.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jean-moldovan picture jean-moldovan  路  3Comments

victorborgaco picture victorborgaco  路  3Comments

adwidianjaya picture adwidianjaya  路  3Comments

slowaways picture slowaways  路  3Comments

jippy89 picture jippy89  路  3Comments