Uploaded image for project: 'Click'
  1. Click
  2. CLK-16

JavaScript Form validation



    • New Feature
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • None
    • core
    • None


      Lifted from a click.dev post by Ahmed Mohombe:

      "I made a few proof of concept tests with bigger forms with Click, and unfortunately having no
      browser side validation makes them very uncomfortable for the users.

      I made the tests last week in our intranet, replacing(trying to ) our internal survey
      application. I overlogged the forms, and supplied extra forms for the users to get from
      them feedback about the usability of the forms/framework:
      Even if I tried to design the forms nice, with many hints and help texts, it seems that most users
      have problems:

      • users will fill many fields wrong: at every 4 fields one triggers a validation error.
      • if the forms have more than 10 fields, and the form reloads, they feel frustrated - javascript is
        something else.
      • most users (even if non technical), know that for forms they need javascript activated(maybe used
        from e-bay? ). It seems that they are accustomed to fast feedback about field validation errors,
        and use them as 'help'/'guide'.

      So the conclusion is that we need to add very fast support for javascript validation(and field sets
      -> it was a nightmare to make the forms without direct Click support for the fieldset HTML element).

      The approach adopted by some of the MVC frameworks to implement javascript validation seems however
      very complicated.

      A very simple solution seems to me to automatically integrate wForms into the Form Control:
      wForms from http://www.formassembly.com/
      I think this will require just to follow some conventions and a few defaults so the Form
      control should enforce them if the programmers selects "form.setJSValidation(true);".
      It has support for i18n and it seems by far the most complete and less bug bloated form library.
      I tested all the other available javascript libs available for free, and unfortunately the others
      lay way behind.
      Implementing our own javascript validation lib seems an overkill form me since the browser
      compliance is a very hard work, takes lot of time and test cases.
      Javascript validation however falls clearly in the 80% and most of the users need it.

      Letting this task (to integrate javascript validation in Click Forms) on the users(programmes),
      kills the simplicity of Click and it's arguments over other MVCs, so the Form Control should be by
      default javascript aware.

      What do you think, should we use wForms?"




            medgar Malcolm Edgar
            amohombe Ahmed Mohombe
            0 Vote for this issue
            0 Start watching this issue