SHARE THIS

AddThis share button for Facebook AddThis share button for Twitter AddThis share button for LinkedIn AddThis share button for Google AddThis share button for Email AddThis share button for AddThis
html5 for Geeks

RECENT POSTS

HTML5 and Form Validation
June 12, 2011
HTML5 New Tags!
June 09, 2011
The Wilderness Downtown - Arcade Fire Music Video
June 09, 2011
Videos in All Browsers
June 01, 2011
Drupal 8 and HTML 5
June 01, 2011

TAG CLOUDS

ADVERTISEMENTS

ad ad ad Free Web Directory
Including Internet Resources, Offer automatic, instant and free directory submissions. ad

Recent Posts

June 12, 2011

Contact forms are one of the most common sources of user input. Filling out one of these things is fairly straightforward (right?); just type your full name (since when does your name contain numbers?) in this box here, your email address over there, and look, a place to write nothing but great comments about the websites author (yes, I mean you!).


We all dream of the perfect user; a user who just happens to know what you want, at any given time and is impervious to human error! And then suddenly, reality sinks in, you wake up, fall out of bed and knock your head against the night table. You realize that a little client side validation (as tedious as it may seem) might be beneficial to you as well as your visitors.


For now, Web Developers write their own scripts but in the future, HTML 5 may be the go-to guy for a little form validation. Take a look at the following code:



HTML5 and Form Validation

When the user tries to submit the form the user agent checks if all conditions are being met and if that's the case it submits the form otherwise it shows an error message to the user. The required attribute ensures that the field is not left blank and will prompt the user if they don't enter a value. However, required does not take into account white spaces. In addition to input types such as password and text, HTML 5 introduces 13 new input types: search, tel, url, email, datetime, date, month, week, time, datetime-local, number, range, and color. As seen in the above example, the Email type checks to see whether the input is a valid email address while url makes sure that it is a well formed url.


Here are a few more attributes to pique your interest:

  • pattern - Allows you to validate input using a regular expression.
  • min and max - Used to indicate the allowed range of values.
  • placeholder - For placing default field text.

For more on the input type and other attributes, check out W3.org for a complete list.


2964 comments
June 09, 2011
Html5 and its multiple tags allow developer to write cleaner code, reduce costs and save themselves some time since a good amount of the original tags have been simplified to make our lives easier. For instance, starting with the DOM tag, here is what older HTML uses:

classic html

and it has been replaced with this: <!DOCTYPE>. Thew new features of HTML5 also provides the ability to functions for audio, video embedding and many more. Part of this new exiting language is the set of rules and elements you can use to structure you HTML5 page; some of those are:<nav> , <header>, <footer>, <article>, etc... Working with those elements and rules becomes handy when working on any kind of website where you want to save some time by using "shortcuts". Note that HTML 5 is not fully supported on all browsers yet, so don't forget to have fallbacks to cross-browser technologies!

Check Out the Tags Cheatsheet
243 comments
June 09, 2011




To see a glimpse of the HTML5 awsomness, check out: http://www.thewildernessdowntown.com/ In the search bar add the address where you grew up, and the video will customize to that location. Who knows, it might bring back good memories!
Enjoy!
1471 comments

about

facebook

twitter

The HTML5 for Geeks blog hopes to teach both web designers and developers a few tip and tricks on how to create HTML5 sites. The new HTML5 has a lot of new fun & interactive features and our job is to teach you these new skills! This blog will have articles on this new technology, as well as fun tutorials for all! Check our site at html5.blog.felipevilla.com and start experiencing the fun!

login