خرید بک لینک

Vote count: 0

I create a datepicker and ask to launch an alert on change :

    <input id="datepicker" />
<script>
    $("#datepicker").kendoDatePicker({
    change: function() {
    var value = this.value();
    alert(value); //value is the selected date in the datepicker
    }
    });

</script>

No problem with this, it's working. Now I try to make a function that take the value of the datepicker, and display it on an alert :

function Test(){
var toto = $("#datepicker").data("kendoDatePicker");
var value = toto.value();
alert(value);
}

And modify the the datepicker like this :

<input id="datepicker" />
<script>
    $("#datepicker").kendoDatePicker({
    change: Test()
    });
</script>

And it's not working anymore. The "Test" method is launched without changes on the datepicker, and the datepicker now look like this : datepicker
Any ideas ?

asked 3 mins ago

- - , .

برچسب: نویسنده: استخدام کار تاريخ: چهارشنبه 28 بهمن 1394 ساعت: 19:38

صفحه بندی