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

onchange for RadDatePicker

1 Answer 385 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Raymond
Top achievements
Rank 1
Raymond asked on 12 Dec 2013, 06:02 PM

I tried to implement an onchange event for RadDatePicker but received the error:



 Error: Object doesn't support property or method 'addEventListener'



when I used this javascript:



  function startDateChanged() {
                alert('date changed');
            }
 
pageLoad(){
var sDate = $find("<%=SDate.ClientID %>");
 sDate.onchange = startDateChanged;
 sDate.addEventListener("change", startDateChanged, true);
}





1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 16 Dec 2013, 08:59 AM
Hi Raymond,

Please try the following code snippet which works fine at my end.

JavaScript:
<script type="text/javascript">
    function pageLoad() {
        var sDate = $find("<%=RadDatePicker1.ClientID %>");
        sDate._onDateInputDateChanged = startDateChanged;
    }
    function startDateChanged() {
        alert('date changed');
    }
</script>

Thanks,
Shinu.
Tags
General Discussions
Asked by
Raymond
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or