onchange for RadDatePicker

2 posts, 0 answers
  1. Raymond
    Raymond avatar
    19 posts
    Member since:
    Aug 2013

    Posted 12 Dec 2013 Link to this post

    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);
    }





  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 16 Dec 2013 Link to this post

    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.
Back to Top