[Solved] JS, how to stop process execution if it’s beeing executed …?


Try this little constructor:

function MyForm()
{
  this.check = false;

  this.form = function(){
    var f = this;
    $('#form').submit(function(e){
      e.preventDefault
      if( f.check === false )
      {
        f.check = true;
        $.ajax({
          ...blah blah
          success: function( data )
          {
            //if you want to let them send again, uncomment this next line
            //f.check = false;
          }
        })
      }
  });
  this.form();
}

$(document).ready(function(){
  var my = new MyForm();
});

solved JS, how to stop process execution if it’s beeing executed …?