Uploaded image for project: 'Commons Validator'
  1. Commons Validator
  2. VALIDATOR-106

[validator] Javascript Rendering Extension

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Won't Fix
    • None
    • None
    • JavaScript
    • None
    • Operating System: All
      Platform: All

    • 32343

    Description

      I have developed an extension for Commons Validator that renders the dynamic
      javascript for Form validation.

      More details on the listed web site along with a download of the source code
      and a sample webapp that lets you try it out and shows you the source code.

      • The main component is the ScriptRenderer class which renders the necessary
        javascript for form validation to a StringBuffer.
      • Static javascript methods have more appropriate method signatures and are
        smaller and simpler.
      • fields are validated in the order defined in validation.xml (rather than by
        Validator)
      • it handles 'indexed' field validation
      • I've re-written the Date Validation Javascript Validator so its simpler and
        takes properly into account the difference between the different date patterns.
      • It can now provide "field level" validation - for example in the onchange
        method of a field.

      There are examples of all this in the sample webapp. The only word of warning -
      until a couple of weeks ago I knew virtually no javascript! So it would be good
      if someone experienced could re-view it - the sample webapp shows you the
      generated javascript.

      I would like to add this to Commons Validator, but thought I would post it fore
      re-view first.

      Niall

      Attachments

        Activity

          People

            Unassigned Unassigned
            niallp Niall Pemberton
            Votes:
            3 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: