title: Fullcalendar modal button click runs more times
body: <p>I have a problem with button click in modal (using <code>FullCalendar</code>).</p>
  
  <p>My plan is:<br/></p>
  
  <ol>
  <li>Click on event</li>
  <li>Modal appears with 3 options</li>
  <li>Confirm changes a value in mysql database / Refuse changes a value in mysql database</li>
  </ol>
  
  <p>When I try one time is works very well. But when I close the modal and open an other i click on the refuse/confirm button then it runs more times (2, 4 ...).
  What is the problem??</p>
  
  <p>modal:</p>
  
  <pre><code>&lt;div id="eventContent" title="Event Details" style="display:none;"&gt;
      Name: &lt;span id="name"&gt;&lt;/span&gt;&lt;br&gt;
      Start: &lt;span id="startTime"&gt;&lt;/span&gt;&lt;br&gt;
      End: &lt;span id="endTime"&gt;&lt;/span&gt;&lt;br&gt;&lt;br&gt;
      &lt;p id="eventInfo"&gt;&lt;/p&gt;
      &lt;button id="confirm_button" type="button"&gt;Confirm&lt;/button&gt;
      &lt;button id="refuse_button" type="button"&gt;Refuse&lt;/button&gt;
      &lt;button type="close_button"&gt;Close&lt;/button&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>eventRender:</p>
  
  <pre><code>&lt;script&gt;
      $(document).ready(function () {
  
          $('#calendar').fullCalendar({
              header: {
                  left: '',
                  center: 'prev title next',
                  right: ''
              },
              events: "http://localhost/calendar_directory/calendar_db_connect.php",
              eventRender: function (event, element) {
                  element.click(function () {
                      var start = $.fullCalendar.formatDate(event.start, "YYYY-MM-DD");
                      var end = $.fullCalendar.formatDate(event.end, "YYYY-MM-DD");
  
                      $("#name").html(event.title);
                      $("#startTime").html(start);
                      $("#endTime").html(end);
                      $("#eventContent").dialog({modal: true, title: event.title, width: 350});
  
  
                      $("#refuse_button").click(function ()
                      {
                          var id = event._id;
                          var confirmed_number = 2;
                          var decision = confirm("Do you really want to refuse that?");
  
                          if (decision)
                          {
                              $.ajax({
                                  url: "http://localhost/calendar_directory/confirm_events.php",
                                  data: '&amp;id=' + id + '&amp;confirmed_number=' + confirmed_number,
                                  type: "POST",
                                  success: function (json)
                                  {
                                      console.log(id);
                                      return;
                                  }
                              });
                          }
                      });
  
                      $("#confirm_button").click(function ()
                      {
                          var id = event._id;
                          var confirmed_number = 1;
                          var decision = confirm("Do you really want to confirm that?");
                          if (decision)
                          {
                              $.ajax({
                                  url: "http://localhost/calendar_directory/confirm_events.php",
                                  data: '&amp;id=' + id + '&amp;confirmed_number=' + confirmed_number,
                                  type: "POST",
                                  success: function (json) {
                                      console.log("confirmed");
                                      return;
                                  }
                              });
                          }
                      })
                  });
              },
  
          });
      });
  &lt;/script&gt;
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/4Spis.jpg" rel="nofollow noreferrer">Database structure here:</a></p>
  
  <p>confirmed column can be: 0,1 or 2</p>