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 6560463
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:27:48+00:00 2026-05-25T13:27:48+00:00

I have a simple registration page that validates if a user is already taken.

  • 0

I have a simple registration page that validates if a user is already taken.

I use ajaxSetup for all my ajax calls and for some reason the “success” is never called. When I look at my console (firebug) I can see a successfully request (code 200 OK and I get true or false as the result).

Here’s my code:

$('#checkValidUsername').click(function() {
    // some basic validation like not empty etc...
    $.ajax({
        type: "POST",
        url: '/checkuser.php',
        cache: false,
        data: $("#form").serialize(),
        dataType: 'json',
        success: function(result) {
            // do some actions
        },
    });
}

$.ajaxSetup({
    beforeSend: function() {
        // show loading dialog // works
    },
    complete: function(xhr, stat) {
        // hide dialog // works
    }
    success: function(result,status,xhr) {
        // not showing the alert
        alert('success');
    }
});

What is wrong with my code?
Thank you

  • 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-05-25T13:27:48+00:00Added an answer on May 25, 2026 at 1:27 pm

    because you are already using success in your $.ajax call

    $('#checkValidUsername').click(function() {
        // some basic validation like not empty etc...
        $.ajax({
            type: "POST",
            url: '/checkuser.php',
            cache: false,
            data: $("#form").serialize(),
            dataType: 'json'
    /*
            success: function(result) {
                // do some actions
            },
    */
        });
    }
    
    $.ajaxSetup({
        beforeSend: function() {
            // show loading dialog // works
        },
        complete: function(xhr, stat) {
            // hide dialog // works
        }
        success: function(result,status,xhr) {
            // not showing the alert
            alert('success');
        }
    });
    

    everything in $.ajax will override the $.ajaxSetup.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple user registration page in my rails app that has two
I have simple registration form. Once all information entered, user click submit button and
all. I have a registration page that, well, registers users' inputted data into the
So here is the deal, I have a registration page, in that they need
I have a page. That page is for registration. I have 3 drop-down boxes
I have created a Django app. I have a registration page(simple HTML form) in
I am trying to create a simple registration form. I have the following: include('User.datatype.php');
I am trying to create simple user registration form. I have an index.html file
We have a simple registration form for our website users where we only require
I have simple win service, that executes few tasks periodically. How should I pass

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.