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

    adding an id attribute to q-input

    Help
    3
    3
    624
    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.
    • N
      neubert last edited by

      Say I have the following q-input:

      <q-input
          v-model="form.email"
          inverted-light
          color="white"
          stack-label="Email:"
          type="email"
          @blur="$v.form.email.$touch"
          :error="$v.form.email.$error"/>
      

      I’d like to be able to make it so that if the domain of the email is mydomain.com that the form action will change to another website (without csrf protection) and the POST will be made to that website instead of the main one.

      To do this I was thinking I could use jQuery. eg. $('#email').val().replace(/^.+@/, '') == 'mydomain.com' then change the form action and submit.

      The only problem is: I don’t know how to set an id attribute on q-input.

      Any ideas?

      1 Reply Last reply Reply Quote 0
      • s.molinari
        s.molinari last edited by

        FIrstly, don’t use jQuery. Adding an Id is like adding an id to any HTML tag. id="fooBar". But, since you don’t need or rather shouldn’t use jQuery, you don’t need the id.

        Just use plain JS to submit your form to the conditionally set URL.

        Scott

        1 Reply Last reply Reply Quote 0
        • matroskin
          matroskin last edited by

          the better use ref instead id

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