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

not getting new date entered in raddatepicker dateinput

1 Answer 41 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Vanika
Top achievements
Rank 1
Vanika asked on 21 Nov 2013, 01:50 PM
Hi,
We have a RadDatePicker control. User can enter/edit manually date in the associated date input box. Then on a save button click we need to perform some validation. The problem is when user manually edits the date and presses enter key while still in the date text box, we do not get the selected date from the raddatepicker control. We need this new date value in the validation function. How can we resolve this ?

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 22 Nov 2013, 04:38 AM
Hi Vanika,

Please have a look into the following code snippet to get the SelectedDate from the RadDatePicker.

ASPX:
<telerik:RadDatePicker ID="RadDatePicker1" runat="server">
</telerik:RadDatePicker>
<telerik:RadButton ID="RadButton1" runat="server" Text="Save" AutoPostBack="false"
    OnClientClicked="OnClientClicked1">
</telerik:RadButton>

JavaScript:
<script type="text/javascript">
    function OnClientClicked1(sender, args) {
        var datePicker = $find("<%=RadDatePicker1.ClientID %>");
        alert(datePicker.get_selectedDate());
        //Your code for validation
    }
</script>

Let me know if you have any concern.
Thanks,
Princy.

Tags
Calendar
Asked by
Vanika
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or