Form Elements and HTML5
Ok so I’m back. This time with a post on using HTML5. Wow there is alot of new stuff in HTML5 but I’m going to focus on the some of the new FORM element goodies available since we use alot of fill-in forms on Careerlink.
First lets talk about the ‘placeholder’ attribute for the input element. Adding the ‘placeholder’ attribute and a corresponding value to a form input (type text) will display text inside of said text box matching the placeholders value. The placeholder text will disappear as soon focus is applied to that field. This is a very nifty feature and the placeholder attribute deprecates very nicely with browsers that don’t support it. Cheap and easy
Our next friend is the ‘autofocus’ attribute. This tag should have been around since the start of the Internet but now has just arrived on the scene. This attribute moves the input focus to a particular text input field upon the. The support for this attribute is limited so you will need to code a fallback javascript solution just in case.
Finally one of the things I’m really excited about is the automatic input validation that’s only present in just a few of the latest browsers at the moment, this should make basic client side input validation using javascript a thing of the past. Peace out people.
