PHP/JS : Preventing doubleinserting with function
<p>Yes im having a issue i thought i didn't have.</p>

<p>When you submit it runs a javascript function, that runs an ajax call. This function have this right under it´s name(first line in the function):</p>

<pre><code> $('#submitWall').attr('disabled', true);
</code></pre>

<p>This works very well, but not so well for the faster humans...I tried to click/pressing enter really fast, and it inserted to the database 2-3 times.</p>

<p>And I want to prevent this. As i said i have the above, which didn't solve it 100%.</p>

<p>Is there a solution for this in JS/jquery or maybe in PHP, so there's like a 1 second timelimit somehow..?</p>

<p>Here's my function:</p>

<pre><code>    function DoWallInsert(BuID, uID){
     $('#submitWall').attr('disabled', true);
  var wrapperId = '#wall_insert';
    $.ajax({ 
       type: "POST",
       url: "misc/insertWall.php",
    data: {
    value: 'y',
    BuID : BuID,
    uID : uID,
    message : $('#message').val() 
    },
       success: function(msg){
$('#submitWall').attr('disabled', false);
     $(wrapperId).prepend(msg);
     $(wrapperId).children().first().slideDown('slow');
     $('#message').val("");
        }
     });
}
</code></pre>
