Page is a not externally linkable
- Code, Content, and Presentation
-- JavaScript and AJAX
---- A Universal Script for Javascript Form Validation


vincevincevince - 8:02 am on Oct 12, 2008 (gmt 0)


Here are some important things which are implemented in server-side validation libraries here.

  • Future Date (i.e. scheduling meeting etc. must be future)
  • Valid Date (is the date on the 31st Feb? etc.)
  • Greater Than FieldX (price ranges, date ranges, etc.)
  • Less Than FieldX (age at least 14 etc.)
  • UNIQUE (you absolutely need a callback ability via AJAX or similar to check if a username, etc. is unique)
  • Regex (support for typing REGEX directly)
  • URL (including http and https)
  • Relative URL (expecting a local link)
  • MATCHES (callback to find a matching record - i.e. send to named member)
  • Filter (do not permit a string containing one of listed words)
  • CAPTCHA (if you can check by callback before actual submission, that would be gold)
  • Exactly (equal to a predefined string; e.g. agree to TOS value must be exactly 1, signature box exactly 'USERS NAME', etc.)
  • Image/file type check

    I think you really should consider building this to be driven server side, data in a database, with generated Javascript code for the fields. You are going to have to do the server side validation anyway - and it'll be mostly the same thing. Nobody likes to do things twice!


    Thread source:: http://www.webmasterworld.com/javascript/3749043.htm
    Brought to you by WebmasterWorld: http://www.webmasterworld.com