PricingBlog

How to create an event based on KEYDOWN that equals the ENTER button being pressed inside a FORM.

  • .crypto618-1210734435885121607

    Crypto 618

    2 years ago

    Hi,
    Have a simple form with two inputs, firstname and lastname and a button. I would like to submit the from when the ENTER button is pressed within the form or input fields. Basically using the keyboard to submit the form. Any suggestions? Thanks
  • lucasg-1210739397780316230

    Lucas G

    2 years ago

    Keydown can be used with inputs and buttons
  • You'd set up a Switch condition on the Keydown event
  • 1210739643923042324-image.png
    👍1
  • With that condition
  • 128651941143117824-@Lucas G
    .crypto618-1210753780769882193

    Crypto 618

    2 years ago

    Thankyou I will give that a try 🙂
  • building_stuff-1212391672609120256

    Janis

    2 years ago

    Where would I need to create the keydown event? On the first level or on the button that triggers the event?
  • .crypto618-1213260772763770910

    Crypto 618

    2 years ago

    I discovered the the Enter button automatically submits a form so I did not end up using the keydown event.
  • .crypto618-1213261461111971841

    Crypto 618

    2 years ago

    Also I learned that the when you first setup the Keydown event you can't see the "key" as event has not happened yet. Go to live view and press a button. Then go back to keydown event and you will see the "key" so that you can work your logic.