This is a migrated thread and some comments may be shown as answers.

Input type - Date set value in html

1 Answer 534 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Sadiq
Top achievements
Rank 1
Sadiq asked on 22 Mar 2013, 12:02 AM

Hi,

I am dynamically adding controls by building the HTML and then inserting it. I need to insert a date input box with a value already selected


strHTML ='<input type="date" id="' + val["ID"] + '" name="Date-' +val["Description"]+ '" datatype="date" att="' + val["ID"] +'" onblur="doneEditing(this)" value ="' + val["value"]+ '"/>';

 val["value"] is a valid date string.  

What should I do to get this working? 

Thank you.

1 Answer, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 25 Mar 2013, 05:46 PM
Hi Sadiq,

Please make sure that the date string is in the right format - according to the HTML5 date input specification value attribute expects "yyyy-mm-dd"  format. For example:
<input type="date" value="2012-03-22" />

For more information please check this forum post.

Regards,
Alexander Valchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
General Discussions
Asked by
Sadiq
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Share this question
or