Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-6067

Provide an Ajax Behavior that prevents form submit on ENTER

    XMLWordPrintableJSON

Details

    • Wish
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 7.1.0
    • 7.2.0, 8.0.0-M1
    • wicket
    • None

    Description

      By default when the user presses ENTER key while in a HTML form element the browser will submit the form.
      Sometimes this is not desired and the application wants to prevents the submit event.
      There are questions in StackOverflow [1] and in Wicket JIRA [2] how to do this.
      I think it is a common problem and Wicket should provide an AjaxBehavior or AjaxCallListener instead of every application to create its own.

      1. http://stackoverflow.com/questions/19728494/wicket-preventing-form-submission-by-a-textfield-within-a-wizard-step
      2. https://issues.apache.org/jira/browse/WICKET-4499

      Attachments

        Activity

          People

            mgrigorov Martin Tzvetanov Grigorov
            mgrigorov Martin Tzvetanov Grigorov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: