Click
  1. Click
  2. CLK-586

Form javascript validation not called when form is submitted with a SubmitLink

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1.0 RC1
    • Fix Version/s: 2.1.0
    • Component/s: extras
    • Labels:
      None

      Description

      Calling form.submit() does not execute code on the onsubmit=".." event handler:

      http://bytes.com/topic/javascript/answers/147399-submitting-form-onsubmit-validation

      so the the validation code must be also be called on the onclick=".." event handler for the SubmitLink.

      1. form-example.zip
        2 kB
        Finn Bock
      2. submitlink.patch
        0.9 kB
        Finn Bock

        Activity

        Hide
        Bob Schellink added a comment -

        Great patch Finn. Its applied to trunk. Thanks.

        Show
        Bob Schellink added a comment - Great patch Finn. Its applied to trunk. Thanks.
        Hide
        Finn Bock added a comment -

        A patch that add an explicit call to the on_form_submit() method before calling Click.submitLinkAction(..)

        Show
        Finn Bock added a comment - A patch that add an explicit call to the on_form_submit() method before calling Click.submitLinkAction(..)
        Hide
        Finn Bock added a comment -

        Example app.
        Using the button the javascript prevents submitting to the server.
        Using the SubmitLink the form is submitted even when the field is empty.

        Show
        Finn Bock added a comment - Example app. Using the button the javascript prevents submitting to the server. Using the SubmitLink the form is submitted even when the field is empty.

          People

          • Assignee:
            Bob Schellink
            Reporter:
            Finn Bock
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development