title: Fullcalendar change prompt instead popup
body: <p>I have problem with change adding events with prompt instead popup in my fullcalendar. I have already tryed some solutions from SO example: <a href="https://stackoverflow.com/questions/8827975/full-calendar-add-event-not-via-promot">Full Calendar Add event not via promot</a>?</p>
  
  <p>This solution working me now, but only onece!
  When I click to calendar there is working popup, event is stored into my database. But when I try to add next event with click there is still text from previous event, and when I try to change and add next event with submit button, nothings happend. Next event is not possible to add, only after refresh website.</p>
  
  <p>Anyway this is my code with popup:</p>
  
  <pre><code>$(document).ready(function () {
      var date = new Date();
      var d = date.getDate();
      var m = date.getMonth();
      var y = date.getFullYear();
      var calendar = $('#calendar').fullCalendar({
          aspectRatio: 1.45,
          droppable: true,
          weekend: true,
          firstHour: 7,
          columnFormat: {
            month: 'dddd',    
            week: 'ddd, dS', 
            day: 'dddd, MMM dS'
         },
          header: {
              right: 'prev,next',
              center: 'title',
              left: 'month,agendaWeek,agendaDay'
         },
          viewDisplay: function(view) {
                try {
                    setTimeline();
                } catch(err) {}
         },          
          agenda: 'h:mm{ - h:mm}',
                  '': 'h(:mm)t',
          drop: function (date, allDay) {
              var originalEventObject = $(this).data('eventObject');
              var copiedEventObject = $.extend({}, originalEventObject);
              copiedEventObject.start = date;
              copiedEventObject.end = new Date(date.getDate()+2);
              copiedEventObject.allDay = allDay;
              start = $.fullCalendar.formatDate(copiedEventObject.start, "yyyy-MM-dd HH:mm:ss");
              end = $.fullCalendar.formatDate(copiedEventObject.end, "yyyy-MM-dd HH:mm:ss");
              $.ajax({
                      url: '&lt;?php echo SITEURL; ?&gt;/fullcalendar/add_events.php',
                      data: 'title=' + copiedEventObject.title + '&amp;start=' +start + '&amp;end=' +end + "&amp;backgroundColor=" + copiedEventObject.backgroundColor + '&amp;creator=&lt;?php print_r($_SESSION["uid"]); ?&gt;',
                      type: "POST",
                      success: function (response) {
                          console.log(response);
                          $('#calendar').fullCalendar('refetchEvents');
                      }
                  });
              if ($('#drop-remove').is(':checked')) {
                  $(this).remove();
              }
          },
          editable: true,
          defaultView: 'agendaWeek',
          firstDay: 1,
          handleWindowResize: true,
          dragOpacity: 0.7,
          allDayDefault: false,
          events: "&lt;?php echo SITEURL; ?&gt;/fullcalendar/events.php?creator=&lt;?php print_r($_SESSION['uid']); ?&gt;",
          timeFormat:  'HH:mm { - HH:mm}',
          selectable: true,
          selectHelper: true,
          select: function (start, end, allDay) {
              $(".popup").show();
              $(".submitForm").click(function(){
                  var title = $(".title").val();
                  if (title) {
                      start = $.fullCalendar.formatDate(start, "yyyy-MM-dd HH:mm:ss");
                      end = $.fullCalendar.formatDate(end, "yyyy-MM-dd HH:mm:ss");
                      $.ajax({
                          url: '&lt;?php echo SITEURL; ?&gt;/fullcalendar/add_events.php',
                          data: 'title=' + title + '&amp;start=' + start + '&amp;end=' + end +  '&amp;creator=&lt;?php print_r($_SESSION["uid"]); ?&gt;',
                          type: "POST",
                          success: function (json) {
                              console.log(json);
                              $('#calendar').fullCalendar('refetchEvents');
                          }
                      });
                   console.log("start " + start + " end " + end);
                  }
                  calendar.fullCalendar('unselect');
                  $(".popup").hide();
              });
              $(".exit").click(function(){
               // clear all info, unselect events and...
                $(".popup").hide();
              });
          },
          eventDrop: function (event, delta) {
              start = $.fullCalendar.formatDate(event.start, "yyyy-MM-dd HH:mm:ss");
              end = $.fullCalendar.formatDate(event.end, "yyyy-MM-dd HH:mm:ss");
              $.ajax({
                  url: '&lt;?php echo SITEURL; ?&gt;/fullcalendar/update_events.php',
                  data: 'title=' + event.title + '&amp;start=' + start + '&amp;end=' + end + '&amp;id=' + event.id,
                  type: "POST",
                  success: function (response) {
                           console.log(response);
                    }
              });
          },
          eventClick: function (event, jsEvent, view) {
              if (confirm("Really delete event " + event.title + "with id " + event.id + "?") ) {
                 $.ajax({
                  url:   "&lt;?php echo SITEURL; ?&gt;/fullcalendar/delete_event.php",
                  data: 'eid='+event.id,
                  type: "POST",
                  success: function (response) {
                        console.log(response); 
                        calendar.fullCalendar('removeEvents', event.id);
                    }
                  });
              }
          },
          eventResize: function (event) {
              start = $.fullCalendar.formatDate(event.start, "yyyy-MM-dd HH:mm:ss");
              end = $.fullCalendar.formatDate(event.end, "yyyy-MM-dd HH:mm:ss");
              $.ajax({
                  url: '&lt;?php echo SITEURL; ?&gt;/fullcalendar/update_events.php',
                  data: 'title=' + event.title + '&amp;start=' + start + '&amp;end=' + end + '&amp;id=' + event.id,
                  type: "POST",
                  success: function (response) {
                        console.log(response);
                  }
              });
          }
      });
      $('#external-events div.external-event').each(function () {
          var eventObject = {
              title: $.trim($(this).text()),
              backgroundColor : $.trim($(this).attr('bgc'))
          };
          $(this).data('eventObject', eventObject);
          $(this).draggable({
              zIndex: 999,
              revert: true, 
              revertDuration: 0
          });
      });
  });
  </code></pre>
  
  <p><strong>My html:</strong></p>
  
  <pre><code>&lt;div class="popup" style="display:none; position:fixed; top:25%; left:25%; background-color:white;"&gt;
    &lt;input class"title" type="text" size="26" /&gt;
    &lt;a href="#" onclick="return false" class="submitFrom"&gt;submit&lt;/a&gt;&amp;emsp;
    &lt;a href="#" onclick="return false" class="exit"&gt;cancel&lt;/a&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I will very gratefull for any help.
  thanks a lot !!!!!
    
    submit&emsp;
    cancel
  </p>
  
  <hr>