Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8252957
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T00:42:31+00:00 2026-06-08T00:42:31+00:00

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’);

  • 0

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 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T00:42:32+00:00Added an answer on June 8, 2026 at 12:42 am
    $.post('ajax/aj_adduser.php', $("form#adduserform").serialize(), function(result) {
        disablePopup();   
        if(result.YourMessage == ...){
            $('#addsuccess').delay(200).fadeToggle('slow').delay(2000).fadeToggle('slow');     
        }  
        else{ ... }        
        $('div.mainadmin').html(result);            
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code in my ajax: $.ajax({ url : <?php echo site_url('user/add'); ?>,
I have my form in a table and I use this code to add
I have a code like this $(document).ready(function(){ $(.add).bind ('click', function () { $('.main').append('<div class=add>Add
I have this code that I run when a user submits a form (this
I have this quickBox2d code to add a cricle to the stage: var ball:QuickObject
I have this code : http://jsfiddle.net/VAkLn/6/ When i add a table : http://jsfiddle.net/VAkLn/7/ this
i have this code: var list = new List<int>(); for(int i=0;i<10;i++) list.Add(i); for(int i=0;i<10;i++)
I have this code: app = new Application(); app.Visible = false; workbook = app.Workbooks.Add(1);
So i have this code: foreach (string xmlfilelisted in xmlFileList) { resultXml.Root.Add(XDocument.Load(xmlfilelisted).Root.Elements()); resultXml.Save(filepath); }
i have this javascript code to which i want to add the jquery fade-in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.