SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Wizard lukeurtnowski's Avatar
    Join Date
    Mar 2003
    Location
    Coronado
    Posts
    1,618
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    form validation?

    Is form validation obsolete new the HTML5 came out with the use of the new pattern attribute and the required attribute?

    Thanks..
    "Oh, and Jenkins--apparently your mother died this morning."

  2. #2
    Mouse catcher silver trophy Stevie D's Avatar
    Join Date
    Mar 2006
    Location
    Yorkshire, UK
    Posts
    5,881
    Mentioned
    122 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by lukeurtnowski View Post
    Is form validation obsolete new the HTML5 came out with the use of the new pattern attribute and the required attribute?
    As there are still a lot of web browsers out there that don't support these features, form validation is still alive and well! Hopefully in time, as these dinosaur browsers wither and die, we will reach a stage where we can ignore server-side validation for most forms. Of course, we may still need to use some server-side validation to prevent malicious use of the form, as relying on client-side validation means that it would be possible for people to circumvent it if they were so minded, so we will never be able to guarantee that client-side validation will work 100%.

  3. #3
    om nom nom nom Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,271
    Mentioned
    50 Post(s)
    Tagged
    2 Thread(s)
    Pattern is also limited compared to what you can do with Javascript.

    Also the error messages, especially with pattern, are very limited. You'll want to write better ones than what the browser comes up with :)

  4. #4
    Mouse catcher silver trophy Stevie D's Avatar
    Join Date
    Mar 2006
    Location
    Yorkshire, UK
    Posts
    5,881
    Mentioned
    122 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by Stomme poes View Post
    Pattern is also limited compared to what you can do with Javascript.

    Also the error messages, especially with pattern, are very limited. You'll want to write better ones than what the browser comes up with
    Except that you should be making it clear before people type anything what the requirements of the field are, so they shouldn't have to wait for the error message to tell them what they've done wrong!

  5. #5
    om nom nom nom Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,271
    Mentioned
    50 Post(s)
    Tagged
    2 Thread(s)
    Well and have you seen the error messages for pattern? They don't tell you what you did wrong! :)

    I waver between placeholder-like things for patterns versus an aria-describedby linked p with further explanation. Sometimes it can fit in the label (dd-mm-yyyy) but other times not.

  6. #6
    Community Advisor silver trophybronze trophy
    dresden_phoenix's Avatar
    Join Date
    Jun 2008
    Location
    Madison, WI
    Posts
    2,791
    Mentioned
    34 Post(s)
    Tagged
    2 Thread(s)
    Not is ever obsolete, per say. Form validation is EASIER IN HTML5.. but can you be sure every visitor is using an HTML5 capable browser?? So what about those who arent?

    Going back to the HTML5, it's really easy to customize the validation functions ( but yeah, it requires some simple .js and a a HTML5 capable browser)

  7. #7
    om nom nom nom Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,271
    Mentioned
    50 Post(s)
    Tagged
    2 Thread(s)
    It requires JS anyway... so might as well have full control and use JS entirely.

    In the end it's only there for one reason: help push users into filling out the right information in the right format in the right field the first time. Back-end validation does the real validation anyways.


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
  •