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

DateTimePicker and Javascript

2 Answers 88 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Jaymie
Top achievements
Rank 1
Jaymie asked on 05 Jan 2011, 06:13 PM
I have a need to set the value of the DateTimePicker control via javascript.
After a bit of research I came up with this:

function setDate() {
    var picker = $find('<%= dtStart.ClientID %>');
    var picker2 = $find('<%= dtEnd.ClientID %>');
    picker2.set_selectedDate = picker.get_selectedDate;
}

But this does not work. I think I need some help, could someoen point me in the right direction please?

2 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 06 Jan 2011, 06:14 AM
Hello Jaymie,


Modify your code as shown below to get it working.

Client Code:
<script type="text/javascript">
    function setDate() {
        var picker = $find('<%= dtStart.ClientID %>');
        var picker2 = $find('<%= dtEnd.ClientID %>');
        var date = picker.get_selectedDate();
        picker2.set_selectedDate(date);
    }
</script>

More info:
Client-Side Basics
RadDatePicker Client Object


-Shinu.
0
Jaymie
Top achievements
Rank 1
answered on 06 Jan 2011, 12:45 PM
thanks, that worked beautifully :)
Tags
Calendar
Asked by
Jaymie
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Jaymie
Top achievements
Rank 1
Share this question
or