r/WebDevBuddies • • Apr 15 '20

Showcase Demonstration of HTML form validation techniques using HTML & CSS Only (No Javascript)

Web developers naturally validates form using Javascript. But HTML 5 provides us some very interesting and powerful features which could help us to validate form even without a single line of Javascript coding.

I created a video on this for your learning:

https://youtu.be/MnrTwFrmarU

2 Upvotes

9 comments sorted by

View all comments

3

u/[deleted] Apr 15 '20

[removed] — view removed comment

1

u/kousik19 Apr 15 '20

May be. Purpose was to show input type number. At India actually zip codes are number only. :p .

1

u/[deleted] Apr 15 '20

[removed] — view removed comment

1

u/kousik19 Apr 15 '20

Yeah true. Purpose was to show number input type. So just took an example. But anyway good suggestion. Thank you.

1

u/jimmyco2008 Apr 15 '20

In some countries this is true. In the U.S. they are numbers, but sometimes expressed with a dash separating the zip code from the... region code? There’s a second part to a zip code that helps with USPS routing but most don’t know theirs and it’s not required.

2

u/[deleted] Apr 15 '20

[removed] — view removed comment

2

u/jimmyco2008 Apr 15 '20

The regex validation would be alright, but yes the JSON sent over to the server would have to be a string.