Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialAndrew Phythian
19,747 PointsBenefit of using Javascript over HTML5 form verification
Just wondering if there are any benefits to using the javascript procedures outlined in this and proceeding video's for checking the contents of a form field against a regex when the same process can be done relatively simply using the HTML5 verification steps outlined here.
2 Answers
Steven Parker
231,275 PointsI'd think the main advantage to validating in JavaScript is if you want something other than the default HTML behaviors. For example, instead of just red borders, you might want explicit helper messages to appear.
Everistus Akpabio
2,929 Pointshtml attributes can easily be deleted from the inspect and pass validation
Aakash Srivastav
Full Stack JavaScript Techdegree Student 11,638 PointsAakash Srivastav
Full Stack JavaScript Techdegree Student 11,638 PointsThanks Steven Parker :)
Andrew Phythian
19,747 PointsAndrew Phythian
19,747 PointsYea, after playing around with the javascript there's a lot more flexibility.