Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/452.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/72.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_Html_Fullcalendar - Fatal编程技术网

Javascript 完整日历事件源数据在参数中传递空值

Javascript 完整日历事件源数据在参数中传递空值,javascript,jquery,html,fullcalendar,Javascript,Jquery,Html,Fullcalendar,我正在使用jQuery完整日历。单击完整日历将发送post请求时,会放置一个按钮。 单击按钮,日历需要从文本框中获取值,并从站点中重新提取事件 错误是当单击按钮时,将发送文本框中的空值,并发送默认的选择项值,而不是用户输入的新值 如何解决这个问题。下面是代码 $('#search').click(function() { $('#calendar').fullCalendar('refetchEvents'); }); $('#calendar').ful

我正在使用jQuery完整日历。单击完整日历将发送post请求时,会放置一个按钮。 单击按钮,日历需要从文本框中获取值,并从站点中重新提取事件

错误是当单击按钮时,将发送文本框中的空值,并发送默认的选择项值,而不是用户输入的新值

如何解决这个问题。下面是代码

    $('#search').click(function() {

        $('#calendar').fullCalendar('refetchEvents');

    });

 $('#calendar').fullCalendar({
            defaultView: 'agendaDay',
            header: {
                left: 'prev,next today',
                center: 'title',
                right: 'agendaDay'
            },
            cache: false,
            eventSources: [
                    {
                        url: "http://" + window.location.host + "/Appointment/Appointments/",
                        type: 'POST',
                        data: {
                            doctor: $("input[name=Doctor]").val(), **//NULL VALUE IS SENT**
                            room: $('select[name=Room]').val() **//DEFAULT SELECT LIST ITEM VALUE SENT**
                        },
                        error: function() {
                            alert('there was an error while fetching events!');
                        },
                        success: function (dataQ) {

                            for (var i = 0; i < dataQ.length; i++) {
                                dataQ[i].start = moment(dataQ[i].start);
                                dataQ[i].end = moment(dataQ[i].end);
                            }
                        },
                        color: 'grey',   
                        textColor: 'white' 
                    }
            ]
        });
$(“#搜索”)。单击(函数(){
$(“#日历”).fullCalendar('refetchEvents');
});
$(“#日历”).fullCalendar({
defaultView:'agendaDay',
标题:{
左:“上一个,下一个今天”,
中心:'标题',
右图:“agendaDay”
},
cache:false,
事件来源:[
{
url:“http://”+window.location.host+“/Appointment/Appointment/”,
键入:“POST”,
数据:{
医生:$(“输入[name=doctor]”).val(),***//发送空值**
文件室:$('select[name=room]')。val()**//发送的默认选择列表项值**
},
错误:函数(){
警报('获取事件时出错!');
},
成功:函数(dataQ){
对于(变量i=0;i
$(“输入[name=Doctor]”)。val()
在加载页面时在此处计算一次。这就是为什么您在输入中输入的内容不会被发送的原因

您可能应该使用以下函数加载事件: