Tuesday, January 04, 2011

Playing Around With HTML5 Client Side Forms Validation

Whoops! The link below is broken - I'm trimming down the number of domains I own and moopoint.com was one I let go. I'll bring the code up under the bryansgeekspeak.com domain at some point in the future!

So far, I love the FireFox4 beta. I had completely switched to Chrome on my laptop at home (I have to use IE at work since its our client's standard browser -.-) but now I'm slowly switching back to FireFox - mostly for the neat HTML5 features they're implementing.

One of the cool new things for web developers that they just added to the FireFox beta is built in Forms Validation. In your input tag markup, you can now add the attributes "required" and "pattern=''" and FireFox will now automagically require the field to be not empty and/or the value must pass the regex supplied in the pattern attribute of the input tag. Sweet! That means less custom javascript code in your web applications and cleaner HTML markup :-D

I've put up a simple example of the validation in action here - http://www.moopoint.com/FormsValidation.html.

No comments: