Q-Form Validation Issues
-
I have a large q-form around a stepper component, and when I make a validate() call, only some of the dynamically created fields which require input are flagged. All of the fields are custom variations of q-input or q-select, but I cannot work out why some of these correctly display as being required, when others do not.
If you tab through each the components, all works as expected, but if you jump to the next step of the process without tabbing, the user is not alerted of required content.
So I need to simulate a focus event on all of the components of a step to get this to work. Any suggestions how I could go about this or are there other ways to work around this?
-
@btmi you need to inhibit visiting all the tabs first, since those are lazy loaded so it won’t be validated if the tabs aren’t explored yet.
-
@metalsadman I am blocking more than 1 tab ahead, but I was hoping to use validation to stop progress, but it is only working for some fields and not others.
-
@btmi also know that qform will only be able to detect level 1 form component. Check the source here https://github.com/quasarframework/quasar/blob/dev/ui/src/components/form/QForm.js#L155
-
What do you mean with level 1 form components? How can you create a level 2 component in Qform?
-
@dobbel check the source, what i mean was inner or wrapped form components won’t be validated by qform. might work if you add a class on the component since it seem the code just looks for
q-validation-component
.