title: Fullcalendar AJAX call fired multiple times without reloading page
body: <p>When I click a day in month view, a modal will pop-up. </p>
  
  <p>Inside that modal is a button for adding a new event. When I click that, another modal will pop-up for the Add Event form.</p>
  
  <p>The problem is when I frequently open/close the first modal and try to add an event after that without reloading the page, the AJAX call fires multiple times even if I click the submit only once. Sometimes it multiplies up to 7 times. </p>
  
  <p>I don't know what the problem is.</p>
  
  <p>My code:</p>
  
  <pre><code>$(document).ready(function() {
        var calendar = $('#calendar').fullCalendar({
          header: {
            left: 'today',
            center: 'prev title next',
            right: 'month,basicWeek,basicDay'
          },
          eventOrder: 'start',
          editable: true,
          droppable: true,
          eventLimit: true,
          selectable: true,
          selectHelper: true,
          events: 'getEvents.php',
          eventRender: function(event, element, view) {
              var today = new Date();
              var startString = moment(event.start).format('YYYY-MM-DD');
              var endString = moment(event.end).format('YYYY-MM-DD');
              $(element).each(function () { 
                $(this).attr('date-num', event.start.format('YYYY-MM-DD')); 
              });
          },
          eventAfterAllRender: function(view){
            for( cDay = view.start.clone(); cDay.isBefore(view.end) ; cDay.add(1, 'day') ){
              var dateNum = cDay.format('YYYY-MM-DD');
              var dayEl = $('.fc-day[data-date="' + dateNum + '"]');
              var eventCount = $('.fc-event[date-num="' + dateNum + '"]').length;
              if(eventCount){
                var html = '&lt;span class="event-count"&gt;' + 
                          '&lt;i&gt;' +
                          eventCount + 
                          '&lt;/i&gt;' +
                          ' Events' +
                          '&lt;/span&gt;';
  
                dayEl.append(html);
              }
            }
          },
          dayClick: function(start, end, event) {
            var st = start.format('YYYY-MM-DD HH:mm:ss');
            var en = start.format('YYYY-MM-DD HH:mm:ss');
  
            function fetch_data() {
              $.ajax({
                url: "view-data.php",
                data: 'action=view&amp;start=' + st + '&amp;end=' + en,
                method: "POST",
                success: function(data) {
                  $('#view-me').html(data);
                  $('#view-data').modal('show');
                }
              });
            }
  
            fetch_data();
  
            $(document).on('click', '.add-me', function() {
              $('#start').val(moment($(this).data('start')).format('YYYY-MM-DD[T]HH:mm:ss'));
              $('#end').val(moment($(this).data('end')).format('YYYY-MM-DD[T]HH:mm:ss'));
              $('#ModalAdd').modal('show');
  
              $('#myFormAdd').on('submit', function(e) { // add event submit
                e.preventDefault();
                doAdd(); // send to form submit function
              });
  
              function doAdd() { // add event
                var title = $('#title').val();
                var start = $('#start').val();
                var end = $('#end').val();
  
                $.ajax({
                  url: 'addEvent.php',
                  data: 'action=add&amp;title=' + title + '&amp;start=' + start + '&amp;end=' + end,
                  type: "POST",
                  success: function(json) {
                    $('#ModalAdd').modal('hide');
                    fetch_data();
                    calendar.fullCalendar('refetchEvents');
                  }
                });
              }
            });
          }
        );
  </code></pre>
  
  <p>My PHP Code: view-data.php</p>
  
  <pre><code> if($_POST['action'] == "view") // view event dayClick
  { 
   $start = $_POST['start'];
   $end = $_POST['end'];
   ?&gt;
  
    //Add new button
    &lt;button title="add new here" class="add-me" data-start="&lt;?php echo $start; ?&gt;" 
    data-end="&lt;?php echo $end; ?&gt;" rel="dialog" &gt;ADD&lt;/button&gt;
  
  &lt;?php 
  
   $sql = "SELECT * FROM events WHERE start BETWEEN '$start' AND '$end' OR end BETWEEN '$start' AND '$end'";  
   $result = mysqli_query($connect, $sql);  
  
   if(mysqli_num_rows($result) &gt; 0)  
   {  
    while($row = mysqli_fetch_array($result))  
    {
    ?&gt;
  
    &lt;span style="overflow:hidden;text-overflow:ellipsis;white-space: nowrap;"&gt;&lt;?php echo $row['title']; ?&gt;&lt;/span&gt;
  
    &lt;?php
    }
    } else {
       echo "&lt;span&gt;No event&lt;/span&gt;";
    }
    }   
    ?&gt;
  </code></pre>