Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/76.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 剑道日历选定日期事件_Javascript_Jquery_Calendar_Kendo Ui - Fatal编程技术网

Javascript 剑道日历选定日期事件

Javascript 剑道日历选定日期事件,javascript,jquery,calendar,kendo-ui,Javascript,Jquery,Calendar,Kendo Ui,嗨,我的页面上有剑道日历和文本框。当我在日历上选择任何日期时,我想在文本框中显示该值。比如日期时间选择器。有办法得到它吗 这是我的示例代码 <div id="calendar"></div> <input type="text" name="txtdate" id="txtdate"/> <script> $(document).ready(function() { //

嗨,我的页面上有剑道日历和文本框。当我在日历上选择任何日期时,我想在文本框中显示该值。比如日期时间选择器。有办法得到它吗

这是我的示例代码

<div id="calendar"></div>
<input type="text" name="txtdate" id="txtdate"/>

 <script>
                $(document).ready(function() {
                    // create Calendar from div HTML element
                    $("#calendar").kendoCalendar();
                });

                var cal = $("#calendar").data("kendoCalendar");

                cal.bind("change", function () {
                    // Here I wanted to bind the selected value to my text box (txtdate).                      
                });
  </script>

请使用此项获取日历的值,var calendar=$calendar.datakendoCalendar;//获取日历的值。var值=calendar.value;请使用这个:this.value;
   var textVal =  $(this).value();
   $('#txtdate').val(textVal);