This imaginary form is constructed with 100% HTML5 standard. No
hacks or tweaks. The form works on all major browsers even in
IE6. What's really amazing is that the form can have dateinputs
and ranges even when JavaScript is disabled! All this with
kB!
Here are all the input fields and scripting for the demo. You
have a sane subset of the HTML5 and Web Forms 2.0 standards
available. Now these complex but useful standards can be used by
humans.
This form uses CSS3 features such as attribute selectors,
rounded borders, RGBA coloring and box shadows. These make web
developers' life much, much easier. Together with FORM Tools and
HTML5 we can finally make well behaving and good looking forms
with ease.
At the time of writing Opera has the best native support for
HTML5. Here is Opera with JavaScript disabled! The browser
displays it's native date and range input controls. Browsers
that does not natively support these special inputs will show
show a normal text field so that the form is editable in all
situations.
Now listen. Internet Explorer has fairly good
JavaScript support so it's possible to make cross-browser
libraries like jQuery Tools; however, IE has many issues with
CSS and HTML. If you want somewhat similar look for IE
you need quite precisely 300% more development time and
money for dirty hacks and redundant images
your application becomes harder to maintain so you also
need 300% more time and money in the future
all this 300% for what? your site will feel like IE6 on
all browsers!
Let me put this another way. There is absolutely no good
reason to develop an identical look for IE6. Period. Respect
the standards and let unstandard browsers do what they
can. Luckily you don't have to compromise with the
funtionality. It's the looks that IE doesn't care about. I
hope IE9 is better.
Here is the HTML layout. An overlay trigger element opens the
overlay which contains tabs. On the first tab we have a form which
is powered with the jQuery Tools Validator, Rangeinput and
Dateinput. Open the actual overlay to see more details.
CSS coding
Here are some of the "highlights" that are contained on
our stylesheet:
JavaScript coding
Here we initialize all tools that are being used: overlay, tabs,
validator, rangeinput and dateinput. There are some custom event
listeners for overlay and tabs that hide validation error messages
if needed.
You need to place the script block after the
HTML code or you can alternatively use
jQuery's $(document).ready to execute the script as
soon as the webpage's Document Object Model (DOM) has been
loaded. Read more about that from
the User's
Manual.