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

Seperate date and time selection

1 Answer 32 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Dan
Top achievements
Rank 1
Dan asked on 15 May 2015, 01:46 PM

I am using the RadDateTimePicker to force user to enter a date and time. But when they select a date using the date calender popup a time (12:00 am) is also entered in the field along with the date.  How can I force the user to also pick a time so users do not leave the default time in the field.  I do not want to use 2 controls  ( one for date and one for time).  I would prefer to use the single control.

Thank you,

 

Dan

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 20 May 2015, 10:36 AM
Hello Dan,

Thank you for contacting us.

You can automatically display the Time PopUp element when a new date is selected in order to hint the user to select a Time, too:
<script type="text/javascript">
    //Put your JavaScript code here.
    function dateSelected(sender, args) {
        if (!args.get_oldDate() && args.get_newDate()) {
            sender.showTimePopup();
        }
    }
</script>
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
</telerik:RadAjaxManager>
<telerik:RadDateTimePicker ID="RadDateTimePicker1" runat="server">
    <ClientEvents OnDateSelected="dateSelected" />
</telerik:RadDateTimePicker>

That should do the trick. Please give it a try and let me know about the result.

Regards,
Eyup
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Calendar
Asked by
Dan
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or