How to prevent the form from being submitted when Enter is pressed on keyboard?

  • lorenzagalimberti
    Domanda del 5 ottobre 2023 alle ore 06:21

    Buongiorno

    come posso evitare che il modulo venga inviato se l'utente clicca sul pulsante invio della tastiera del pc?

  • Raymond Jotform Support
    Risposta del 5 ottobre 2023 alle ore 09:24

    Hi Fratelli,

    Thanks for reaching out to Jotform Support. Unfortunately, our Italian Support agents are busy helping other Jotform users at the moment. I'll try to help you in English using Google Translate, but you can reply in whichever language you feel comfortable using. Or, if you'd rather have support in Italian, let us know and we can have them do that. But, keep in mind that you'd have to wait until they're available again.

    Pressing the Enter button on the keyboard will not automatically submit the form in classic layout. However, if you're using the Cards layout of a form, it will be submitted and can't be disabled. But if you set your fields as required, the form will not be submitted, even when the Enter button is pressed, when at least one of the required fields is empty. Let me show you how to set fields as required:

    • In Form Builder, click on one of your fields.
    • Click on the Gear icon beside it and Enable the Required option.
      How to prevent the form from being submitted when Enter is pressed on keyboard? Image 1 Screenshot 20

    Reach out again if you need any help.

  • lorenzagalimberti
    Risposta del 5 ottobre 2023 alle ore 09:35

    Hi

    Thank you for you answer, I’m not using the card layout, I’m using the classic one but the problem is the same:

    https://eu-submit.jotform.com/232763658134360

    Cordiali saluti

    Lorenza Galimberti


  • Raymond Jotform Support
    Risposta del 5 ottobre 2023 alle ore 09:49

    Hi Lorenza,

    Thanks for getting back to us. I cloned your form and tested it to see if I could replicate the issue, but everything was working properly. Check out the screencast below to see my results:

    How to prevent the form from being submitted when Enter is pressed on keyboard? Image 1 Screenshot 20

    I am pressing the Enter button on my keyboard but the form is not being sent. Are you trying to send the form when the Enter button is pressed? If so, unfortunately, this is not possible. If that’s not exactly what you’re looking for, can you explain a bit more so I can help you better? If you can also share a recording of what's happening, that'll help us understand what's going on better.

    Reach out again if you need any help.

  • lorenzagalimberti
    Risposta del 5 ottobre 2023 alle ore 09:55

    If all the mandatory fields are compilated and you press the enter key the form will be sent. I want it to send only if you click the send button

    Cordiali saluti

    Lorenza Galimberti


  • Raymond Jotform Support
    Risposta del 5 ottobre 2023 alle ore 10:12

    Hi Lorenza,

    That's what I did in my test, but even when I completed the required fields and pressed Enter, the form is not submitted as expected. Can you share what kind of device you're using so we can try and replicate the same on our end?

    Once we hear back from you, we'll be able to help you with this.