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

  • Home
  • SEARCH
  • 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 3391028
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T03:45:31+00:00 2026-05-18T03:45:31+00:00

I am making a registration table which will check if the cellphone number typed

  • 0

I am making a registration table which will check if the cellphone number typed is in use like in twitter’s username check. My code looks perfect but I keep getting ‘Checking number availability’ its like ajax is not POSTing my requests. Help Please 🙂
here is the relevant ajax code bits

<script type="text/javascript">
$(document).ready(function()//When the dom is ready 
{
$("#cellphone_number").change(function() 
{ //if theres a change in the username textbox

var phonenumber = $("#cellphone_number").val();//Get the value in the username textbox
if(phonenumber.length == 13)//if the lenght equal to 13 characters
{
$("#availability_status").html('<align="absmiddle"><font color="#00FF33">Checking Number availability...</font>');
//Add a loading image in the span id="availability_status"

$.ajax({  //Make the Ajax Request
    type: "POST", 
    url: "../Functions/ajax_check_number.php",  //file name
    data: ("number="+phonenumber),  //data
    success: function(server_response)
    {     
   $("#availability_status").ajaxComplete(function(event, request){ 

    if(server_response == '0')//if ajax_check_username.php return value "0"
    { 
    $("#availability_status").html('<align="absmiddle"> <font color="#00FF33">Number is Available </font>  ');
    //add this image to the span with id "availability_status"
    }  
    else  if(server_response == '1')//if it returns "1"
    {  
     $("#availability_status").html('<align="absmiddle"> <font color="#FF0000">Number already in use</font>');
    }  

   });
   } 

  }); 

}
else
{

$("#availability_status").html('<font color="#FF0000">Number too short</font>');
//if in case the username is less than or equal 3 characters only 
}

return false;
});

});
</script>
  • 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-18T03:45:31+00:00Added an answer on May 18, 2026 at 3:45 am

    Now the code is edited at least to a level where even a beginner like me in AJAX and Javascript can understand. This does the job perfectly. Add some GIF images to give a “visual” response to the client side user especially when checking the database.

    <script type="text/javascript">
    $(document).ready(function()//When the dom is ready
    $(document).ready(function()//When the dom is ready
    {
    $("#cellphone_number").change(function()
    
    { //if there's a change in the cellphone_number textbox
    var phonenumber = $("#cellphone_number").val();//Get the value in the username textbox
    if(phonenumber.length == 13)//if the length is equal to 13 characters
    {
    $("#availability_status").html('< align="absmiddle" >&nbsp;<font 
    color="#00FF33">Checking Number availability...</font>');
    //Add a loading image in the span id="availability_status"
    $.ajax({  //Make the Ajax Request
    type: "POST", 
    url: "../Functions/ajax_check_number.php",  //file name
    data: {number:$("#cellphone_number").val()},//data    
    dataType: 'json',  
    success: function(server_response)
    {     
    $("#availability_status").ajaxComplete(function(event, request)
    {     
    if(server_response == '0')//if ajax_check_number.php return value "0"
    { 
    $("#availability_status").html('<align="absmiddle"> <font color="#00FF33">Number is Available </font>  ');
    //add this image to the span with id "availability_status"
    }  
    else  if(server_response == '1')//if it returns "1"
    {  
     $("#availability_status").html('<align="absmiddle"> <font color="#FF0000">Number already in use</font>');
    }
      });
     } 
     });
    }
    else
    {
    
    $("#availability_status").html('<font color="#FF0000">Number too short</font>');
    //if in case the number is less than 13 characters only 
    }
    return false;
    });
    });
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm making a registration form which will have the user put in his birthday.
I'm making a form for user registration. Here's what my template looks like: <h1>Register</h1>
I am making use of django-registration and django-profile to handle registration and profiles. I
I have made a registration program. Making use of mysql database. Can I still
I am making a registration system with an e-mail verifier. Your typical use this
I'm making a registration form for my users and I'd like them to write
Im making a registration script for my site and i want to check if
I am making a registration form in PHP and when submitting the form Date(Check
I'm making a registration form and I want to check if the user has
I am making a registration form. When a user is selecting a username I

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.