Solved

HTML5 Browser Support

Posted on 2012-04-08
3
506 Views
Last Modified: 2012-04-08
I have been using JQuery to show a datepicker for forms where the input type is date. However, upon testing this in Opera - which supports HTML5 validation I get both the JQuery datepicker AND the Opera datepicker - one overlaying the other.

How might I tell that the browser supports this and so switch off the JQuery option, or tell the browser NOT to use its own or any other way of harmonising this?

Also - if I default to using the browser based datepicker - how do I tell it to use UK format dd/mm/yyyy and not ISO format of yyyy-mm-dd?

I should say that in Opera, the JQuery datepicker seems to be ineffective - once you select the Opera picker's date, then you have to select one from the JQuery - but that doesn't affect the displayed date - the one selected from Opera. How might I overcome that?

Finally, how might I style the browser based datepicker - colours mainly.

Many Thanks
0
Comment
Question by:highlawn
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 3

Accepted Solution

by:
fjocke earned 250 total points
ID: 37820798
0
 
LVL 23

Assisted Solution

by:basicinstinct
basicinstinct earned 250 total points
ID: 37820920
in my own sites i have decided not to use html5 date fields because my calendar and date field are better than the native implementation in any browser to date.

the way to tell the browser NOT to make it a date field is to make sure you don't set the type to date:
<input type="date"/>
vs.
<input type="text"/>

You can test to see if the browser "knows" about html5 date fields... from memory you would do this:

var hasHtml5Date, element = document.createElement("input");
element.setAttribute("type", "date");
hasHtml5Date = (element.type == "date");

hasHtml5Date will be true if the browser supports html5 date
0
 

Author Comment

by:highlawn
ID: 37820977
Wow! Quick responses - and very informative. Many thanks. The two links by fjocke are most helpful and the advice by basicinstinct seems - certainly for the present - most sound.

Once HTML5 becomes more rolled out and advanced, then perhaps that is the time to use it and, for now, jquery/js is the more complete answer.

Many Thanks and I'll split the points.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…

737 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question