Results 1 to 4 of 4

Thread: Generic JavaScript Validator & Web forms 2

  1. #1
    Join Date
    Aug 2006
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Generic JavaScript Validator & Web forms 2

    Hello friends,


    I have developed an open source "Generic JavaScript Validator"

    https://sourceforge.net/projects/js-validator/


    I am using some extra form's element like require="yes|no"
    pattern = "^regular expression$"
    authtype=_email|_zip|_digits|_date|... and much more
    errormsg="User's own error message"

    Code generator is also designed by me... which generates some code like this...
    <input type="text" name="email" required="yes" authtype="_email" errormsg="Please Enter Proper Email" />

    Here ...
    My validator traverse DOM (any number's of forms) & doing following...
    require="yes" => dont allow field empty
    authtype="_email" => Match entered email with standard pattern /^[\w]+(\.[\w]+)*@([\w\-]+\.)+[a-zA-Z]{2,7}$/
    errormsg="Please Enter Proper Email" it will alert, the msg "Please Enter Proper Email"

    I need suggestions, releted to web forms 2
    "http://www.w3.org/TR/2006/WD-web-forms-2-20060821/"

    According to Web form 2 standards it also uses pattern,require etc attributes of form's elements... So, what are the chances of acceptation of Web forms 2 by I.E. & Firefox in recent future...? So, that i can make my script compitible with webform2's standard.

    Regards,
    Vikas

  2. #2
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by vikasbhagwagar
    <input type="text" name="email" required="yes" authtype="_email" errormsg="Please Enter Proper Email" />
    I've never been fond of validation systems that require injecting junk into markup. If the extra data has no use as HTML (and it doesn't because browsers will just treat it all as unknown attributes), then it should be included as script data. There are numerous ways to associate such data with the appropriate form control, including ways to allow automated validation (as opposed to writing a submission validator function by hand).

    So, what are the chances of acceptation of Web forms 2 by I.E. & Firefox in recent future...?
    If the respective developers have any sense, nil. The specification is still under development. Committing to any particular version would be problematic if the details were changed before going to Recommendation.

    So, that i can make my script compitible with webform2's standard.
    Don't fiddle with non-existent attributes, and you won't ever have to worry about that.

    Mike

  3. #3
    Join Date
    Aug 2006
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Wiil you please check the link
    Live Example : http://www.vikaskbh.com/example1.html
    W3C Validator : http://validator.w3.org/check?uri=ht...Fexample1.html

    Main aim of this project was to reduce any web-developer's development time.

    (Any novice web-developer won't have to waste so much time in just javascript validation.)

    Thanks for your suggestions.

  4. #4
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by vikasbhagwagar
    Wiil you please check the link
    Live Example : http://www.vikaskbh.com/example1.html
    W3C Validator : http://validator.w3.org/check?uri=ht...Fexample1.html
    Well, what do you expect me (or anyone else) to say about it? What are we to check for? If you're still worried about conflicting with Web Forms 2, I've already suggested a guaranteed way to avoid that.

    Mike

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •