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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T21:36:01+00:00 2026-06-04T21:36:01+00:00

The reason that the title is named jQuery / Javascript undefined isn’t because that

  • 0

The reason that the title is named “jQuery / Javascript undefined” isn’t because that I assume jQuery is a language, I do know that jQuery is a library of javascript language, just in case if some pedantic readers read this. The reason why I wrote that as the title is because I don’t know what is wrong with the code, the jQuery or the Javascript (all jQuery’s code compiled) is wrong.

Okay, back to the question, take a look at the following code, they give me an undefined value

//username validation
function username_val(){
    username_value = $("input[name='username']").val();
    span_error = "span[name='username_error']";
    $(span_error).load('ajax_signup_username', {php_username_error:username_value},  function(){
        return true;
    });
}

I alerted this, and then an “undefined” is returned. I assumed that a true would be returned instead.

function final_val(){
        alert( username_val() );
}

EDIT: Some of you guys said that I can only return true on the success param, but I need this for validation, so if all of the validation methods are true, in the final_val will return true. The point is that I needed a true value in the final_val() or if you guys have other method to validate it, please tell me. Note: I’m in a hurry, so if I misunderstand your answer, please forgive me. I’ll be gone for a few hours, until then I’ll check your answers.

Thanks!

  • 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-04T21:36:02+00:00Added an answer on June 4, 2026 at 9:36 pm

    You need to make the alert( username_val() ); within success function. As .load() is asynchronous method so it can’t return true after immediate call. So you can try this:

     $(span_error).load('ajax_signup_username', {php_username_error:username_value},  function(){
         alert('Something');
         var response = true;
         final_val(response);
     });
    
     function final_val(response){
         alert( response);
     }
    

    here is the doco

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

Sidebar

Related Questions

I know that the reason that Microsoft came out with ASP.NET MVC was to
i have the following function in jQuery and javascript that creates a form element:
What is the reason that this image doesn't stretch its height to be as
What is the reason that in Java, a member with a protected modifier can
What is the specific reason that clone() is defined as protected in java.lang.Object ?
Is there a historic reason that periods are used instead of any other separator
Is there a reason that the object TreeSet.apply method returns SortedSet and not TreeSet
Is there any particular reason that all data members in a class are private
What is the reason that ASP.NET MVC templates are available only for Web Application
For some reason that I don't understand, video websites do not play when using

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.