I have a form that on action: action="javascript:DoWallInsert($idf );"..
Now on this form i have this submit button. I want onclick that it should be disabled, and then enabled again on success (the ajax call inside the function).
<input name="submit" type="submit" id="submit" value="Send">
function DoWallInsert(BuID, uID){
$('#submit').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){
$('#submit').attr('disabled', false);
$(wrapperId).prepend(msg);
$(wrapperId).children().first().slideDown('slow');
$('#message').val("");
}
});
}
I tried this, but it doesnt work