0

Sorry if that question was asked but i was unable to find exact duplicate. I want to have HTML 5 date control that is initialized with date - 19 May 1992. I have tried the following:

<input class="text-box single-line" data-val="true" data-val-date="The field BirthDate must be a date." data-val-required="The BirthDate field is required." id="BirthDate" name="BirthDate" type="date" value="5/19/1992" />

But it's not working. Could anybody give me the right direction?

2

1 Answer 1

2

You need to use a RFC3339 compatible format like 1992-05-19.

Demo: http://jsfiddle.net/kEFd4/

Sign up to request clarification or add additional context in comments.

1 Comment

Yes, that solves my problem. However I noticed that datePicker works in chrome and doesn't work in IE v9.0. So I think it's better to use jQuery DatePicker, not HTML 5 one

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.