adding an id attribute to q-input

  • Say I have the following q-input:


    I’d like to be able to make it so that if the domain of the email is 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(/^.+@/, '') == '' 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?

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


  • the better use ref instead id

Log in to reply