No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Q-Form Validation Issues

    Framework
    3
    6
    1421
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • B
      btmi last edited by

      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?

      metalsadman 1 Reply Last reply Reply Quote 0
      • metalsadman
        metalsadman @btmi last edited by metalsadman

        @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.

        Example https://codepen.io/metalsadman/pen/OJyoYPB

        B 1 Reply Last reply Reply Quote 0
        • B
          btmi @metalsadman last edited by

          @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.

          metalsadman 1 Reply Last reply Reply Quote 0
          • metalsadman
            metalsadman @btmi last edited by

            @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

            dobbel 1 Reply Last reply Reply Quote 0
            • dobbel
              dobbel @metalsadman last edited by dobbel

              @metalsadman

              What do you mean with level 1 form components? How can you create a level 2 component in Qform?

              metalsadman 1 Reply Last reply Reply Quote 0
              • metalsadman
                metalsadman @dobbel last edited by metalsadman

                @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.

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post