Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/474.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/85.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 完整日历html弹出窗口_Javascript_Jquery_Fullcalendar - Fatal编程技术网

Javascript 完整日历html弹出窗口

Javascript 完整日历html弹出窗口,javascript,jquery,fullcalendar,Javascript,Jquery,Fullcalendar,我已经考虑了好几天了,还检查了SO和API文档,我想不出一种方法来使用FullCalendar API中的HTML弹出框,而不是当前提示符来添加事件。有没有一个简单的方法来做到这一点,而不使用另一个插件。并不是说我反对使用插件,这似乎是一件简单的事情,但出于某种原因,我就是不能完全理解它 编辑 我想做的是 选择一天时,会出现一个弹出框 在弹出框中有一个表单,允许我添加事件和描述 感谢您的帮助,谢谢 您考虑过使用jQuery UI吗? 好的,所以我能做到。从正文部分的表单开始 <div cl

我已经考虑了好几天了,还检查了SO和API文档,我想不出一种方法来使用FullCalendar API中的HTML弹出框,而不是当前提示符来添加事件。有没有一个简单的方法来做到这一点,而不使用另一个插件。并不是说我反对使用插件,这似乎是一件简单的事情,但出于某种原因,我就是不能完全理解它

编辑

我想做的是

  • 选择一天时,会出现一个弹出框
  • 在弹出框中有一个表单,允许我添加事件和描述

  • 感谢您的帮助,谢谢

    您考虑过使用jQuery UI吗?

    好的,所以我能做到。从正文部分的表单开始

    <div class="popup"><h3>Add an Event</h3>
    <form><div>Title: </div><input class="title" type="text" /><br /><br />
    <a href="#" class="submitForm">submit</a></form></div>
    
    然后像这样提交表格

    select: function(start, end, allDay){
        $(".popup").show(); // show's pop up
        $(".title").focus(); // auto focus on the field
        var start = Date.parse(start) / 1000; // parse the start time to retain value
        var end = Date.parse(end) / 1000; // same but with end
        $(".submitForm").click(function(){ // on submission
        var title = $(".title").val(); // gets title value
        if(title != ""){ // if the title exists run script
            $.post("insertscript.php", {title: title, start:start, end: end, allDay: allDay}, // be sure to filter data 
            function(){
            $(".title").val(""); // clear title field
            start = ""; // clear start time
            end = ""; // clear end time
            calendar.fullCalendar('unselect');
            calendar.fullCalendar('refetchEvents');
            });
        }
    $(".popup").hide(); // hide pop up box
    });
    },
    

    现在我知道这可能不是最好的方法,但它是有效的,因为我环顾四周三天多寻找答案,似乎没有其他人拥有它,或者至少想分享它,我最后扣上安全带,自己骑上了。我希望它能帮助某些人:)

    我实际上已经看过了,但我的问题是关于实际的弹出窗口。我想显示一个带有表单的弹出窗口,这样我就可以将标题发布到我的数据库中,而不是当前使用的提示框中。您有没有一个示例来说明如何完成此操作?类似于谷歌日历。当你点击某个时间或日期时,它会弹出一个框,框中有一个表单,可以发布一个事件。我有sql和php的东西与提示符一起运行,但是我想在不调用另一个提示符框的情况下为事件添加一个描述。
    select: function(start, end, allDay){
        $(".popup").show(); // show's pop up
        $(".title").focus(); // auto focus on the field
        var start = Date.parse(start) / 1000; // parse the start time to retain value
        var end = Date.parse(end) / 1000; // same but with end
        $(".submitForm").click(function(){ // on submission
        var title = $(".title").val(); // gets title value
        if(title != ""){ // if the title exists run script
            $.post("insertscript.php", {title: title, start:start, end: end, allDay: allDay}, // be sure to filter data 
            function(){
            $(".title").val(""); // clear title field
            start = ""; // clear start time
            end = ""; // clear end time
            calendar.fullCalendar('unselect');
            calendar.fullCalendar('refetchEvents');
            });
        }
    $(".popup").hide(); // hide pop up box
    });
    },