Stop multiple posts
<p>I have a submit button in a modal that uses a dynamic id, everytime i close and reopen the modal and do a submit, it increments the number of posts done.</p>

<p>e.g. the first time it does 1 post, if modal closed and reopened, then 2 posts ,then 3 posts etc.</p>

<p>i clear the console to make sure they all happening the same time.</p>

<p>I am not sure if i am explaining my issue clearly enough but i hope someone can help me.</p>

<p>Here is my code, the post gets done in the dynamic function</p>

<pre><code>    $('#editBtn').live("click", function(){
     var type = $(this).parent().parent().children('div.fullGraph').attr("id");
     $("#filter_" + type).attr('data-id', type + "_draw");
     $("#" + type + "_form").submit(function(){
       var modalid = $(this).children('div.modal-footer').children('input').attr('data-id');
       var reportId = $("#"+type+"_thumbnail").attr('data-reportid');
       saveFilters();
       window[modalid](graphType,reportId);         
       return false;
      });
    });
</code></pre>

<p>the post part:</p>

<p>e.g of postData: id=1&amp;a=abc&amp;b=foo</p>

<pre><code>    $.post(defaultUrl + 'customUrl', postData,
      function(data) {
        // other logic with returned data
      });
    }
</code></pre>
