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

input value format and display format

4 Answers 198 Views
Date/Time Pickers
This is a migrated thread and some comments may be shown as answers.
CH
Top achievements
Rank 1
CH asked on 16 Jul 2013, 12:36 PM
Hi,

Can I use different format for input tag value and date picker display?
as sometimes the form need a full standard date format to submit.

Thanks.

4 Answers, 1 is accepted

Sort by
0
Kiril Nikolov
Telerik team
answered on 16 Jul 2013, 01:42 PM
Hi Cheng-how,

You can use the format configuration option to set the default format of the DatePicker along with parseFormat option that specifies the formats, which are used to parse the value set with value() method or by direct input.

For your convenience here is a jsBin example which demonstrates a possible implementation.
 
Regards,
Kiril Nikolov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Accepted
CH
Top achievements
Rank 1
answered on 16 Jul 2013, 02:15 PM
thanks Kiril Nikolov, this helps a lot.
btw, I found that the value of input tag doesn't change even when the datepicker is changed value and focus out.
Should I manually change the value of input element or it will take care of itself?

thanks..
0
Kiril Nikolov
Telerik team
answered on 16 Jul 2013, 02:58 PM
Hello Cheng-how,

The value attribute of the input is not changed automatically when you pick a date from the widget. But you can achieve this if you bind a function to the change event of the DatePicker and change the attribute of the input element. 

I have edited the JSBin to show this.
 
Regards,
Kiril Nikolov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
CH
Top achievements
Rank 1
answered on 16 Jul 2013, 03:02 PM
I see.. thanks for your quick support.
Tags
Date/Time Pickers
Asked by
CH
Top achievements
Rank 1
Answers by
Kiril Nikolov
Telerik team
CH
Top achievements
Rank 1
Share this question
or