ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
change value of TimePicker in asp.net mvc View
Title:
B
I
{code}
?
I use in asp.net mvc view, an ajax call : $.ajax({ type: "GET",... When Success, i can write date to your datePicker : var d1 = new Date(parseInt(response.DateHeureDebut.substr(6))); $("#myDatePicker").data('api').setDate(d1); // it works I would like to setTime to timePicker like this : $("#myTimePicker").data('api').setTime(d1); // of course, SetTime no exist. how can I do (write a time to your TimePicker) ?
Save Changes
Cancel
Ben
asked at 07 May 2019
Answers
B
I
{code}
?
if you use this timepicker: https://demo.aspnetawesome.com/AjaxRadioListDemo#TimePicker you could call `$('#TimePicker1').val('12:35 AM').change()` as for the `Html.Awe().TimePicker` you can only change its value by manually (or using js) changing the selected value of each dropdown (hour, minute, [ampm])
Save Changes
Cancel
Omu
answered at 07 May 2019
Thanks a lot. It works. I used `@Html.Awe().TimePicker("HeureFin")` without AjaxRadioList Now : @(Html.Awe().AjaxRadioList("Time1").TimePicker(o => o.Caption("time ").Step(15))) And i can change it like this after an ajax call: var t1 = moment(d1).format('hh:mm'); $("#Time1").val(t1).change(); // WORKS Thanks for all Benjamin
at 07 May 2019
Ben
please
Sign In
to leave an answer
By accessing this site, you agree to store cookies on your device and disclose information in accordance with our
cookie policy
and
privacy policy
.
OK