HTML and CSS Reference
In-Depth Information
<p><button type="submit">Submit</button></p>
Write a script to detect support for date and, if it is not available, trigger jQuery UI's
date-picker widget:
if (!Modernizr.inputtypes.datetime) {
I bet you're surprised at how little code is needed for this example, as compared to the
previous one! This is the beauty of adopting a reusable solution, like jQuery UI.
Figure 3-28 shows the result for a browser that does not natively support the date input
Figure 3-28. The jQuery UI date picker is triggered since Firefox 4 does not support the date and time
input types
As in the previous example, this script can appear immediately after the form, or it can
be combined with other scripts at the bottom of the body of your document.
Search WWH ::

Custom Search