Seperate date and time selection

2 posts, 0 answers
  1. Dan
    Dan avatar
    14 posts
    Member since:
    Mar 2007

    Posted 15 May 2015 Link to this post

    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

  2. Eyup
    Admin
    Eyup avatar
    3014 posts

    Posted 20 May 2015 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top