I have this code to add a user:
$.post('ajax/aj_adduser.php', $("form#adduserform").serialize(), function(result) {
disablePopup(); $('#addsuccess').delay(200).fadeToggle('slow').delay(2000).fadeToggle('slow');
$('div.mainadmin').html(result);
});
which works almost fine 🙂
The problem is, that the line:
$('#addsuccess').delay(200).fadeToggle('slow').delay(2000).fadeToggle('slow');
should only be executed if the user was added, so not if the result set contains the message that this user already exists.
How do I fix this? I first tried to execute upon success or not of the POST, but it always succeeds, it is just the outcome, the result set that is different.
All help appreciated!
1 Answer