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

    this.$refs.input.validate(...).then is not a function" the use input validate method

    Help
    3
    5
    681
    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.
    • E
      Ewa last edited by

      hej

      Then I use quasar validate method everything is working, but I have error:

      this.$refs.input.validate(...).then is not a function
      

      my code

              <q-input
                v-model="accountData.Company.subdomain"
                outlined
                color="secondary"
                label-color="grey"
                :label="$t('wizzard.subdomain')"
                :placeholder="$t('wizzard.ex: company name')"
                class="inputField inputField__input-domain"
                type="text"
                :rules="[val => validation.requireRule(val), val => validation.noUppearCaseRule(val), val => validation.domainNoExistRule(accountData.Company), val => validation.noSpecialCharRule(val)]"
                lazy-rules
                ref="domainInput"
                @input="validate"
              >
               ...
      
                  validate(val: boolean): void {
                 (this.$refs.domainInput as any & { validate: () => boolean }).validate().then((res: boolean) => { this.isValid = res;});
               }   
      

      Why it occured? I try to fix it, but I don’t know how.

      1 Reply Last reply Reply Quote 0
      • T
        turigeza last edited by

        @Ewa If you put ref="domainInput" you should call this.$refs.domainInput.validate and not this.$refs.input.validate(...)

        1 Reply Last reply Reply Quote 0
        • E
          Ewa last edited by Ewa

          @turigeza , Good point, but I do some mistake then I created post. In my console I have error

          this.$refs.domainInput.validate(…).then is not a function

          But, this error still occure.

          1 Reply Last reply Reply Quote 0
          • E
            Ewa last edited by

            hej, noone could help?

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

              @Ewa make a codepen.

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