Reputation: 377
I have a jQuery date picker install on several of my web pages using MVC. As such type="date" is added to the control.
So where I agree with the general consensus that browser select is wrong and really don't want to guess on which browsers support what, I do need a solution.
Is there a way to determine if the browser has it's own date picker?
Basically I want to turn off the jquery datepicker if the browser supports it and turn it on if it does not.
The other thing I was thinking was to add a date picker button so the user can either use the default if it works on click the button if they want or need the jQuery date picker. This way at least the two options are not competing.
Suggestion?
Upvotes: 1
Views: 759
Reputation: 377
As Tamil Selvan pointed out in his comment.
This is how I got it to work.
if (!Modernizr.inputtypes.date)
{
$("input[type=date]").datepicker();
}
Upvotes: 1