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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T04:50:50+00:00 2026-06-11T04:50:50+00:00

I am thinking on how to implement this scenario: I have a table orders

  • 0

I am thinking on how to implement this scenario:

I have a table orders where there is a serialNumber field. Then I also a have a PHP page with a form. What I am thinking of doing is that, onBlur or on keypress enter/return of a <input type=text> field, I would like an ajax/jquery script to check the serial number from the text box input if it has an existing record in my mySQL database. Then the script will warn the user that the serial number exists already in the database and will not allow submission.

I know how to implement it with standard form submission but I was thinking is it can be done without the literal pressing of the submit button.

Is there a way to implement this?

  • 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-11T04:50:52+00:00Added an answer on June 11, 2026 at 4:50 am

    for this you can use javascript. create on javascript that called on textbox on blur event.
    here i created on function that called on textbox on blur event.

    function CheckUserName(){
        var UserName = document.getElementById('UserName');
        if(UserName.value != "")
        {
            if (window.XMLHttpRequest)
            {// code for IE7+, Firefox, Chrome, Opera, Safari
              xmlhttp=new XMLHttpRequest();
            }
            else
            {// code for IE6, IE5
              xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
            }
            xmlhttp.onreadystatechange=function()
            {
              if (xmlhttp.readyState==4 && xmlhttp.status==200)
                {
                    var value = xmlhttp.responseText;
                    if(value.length > 1)
                    {
                        document.getElementById('ErrorSpan').innerHTML="User Name Already exist please choose Other User Name";
                        UserName.focus();
                    }
                    else
                    {
                        document.getElementById('ErrorSpan').innerHTML="";
                    }
                }
              }
            xmlhttp.open("GET","checkUserName.php?q="+UserName.value,true);
            xmlhttp.send();
        }
    }
    

    and create one php file with the name checkusername.php and pass your value through query string.

    php code as follow.

    <?php
    $q=$_GET["q"];
    include("db_connect.php");
    
    $sql="select * from usermaster where UserName='".$q."'";
    $result = mysql_query($sql);
    while($row = mysql_fetch_array($result))
      {
        echo $row['UserName'];
      }
    mysql_close($con);
    
    ?>
    

    here from php if username find it will return value and you can get value in your javascript function. i hope it will help you.

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

Sidebar

Related Questions

I haven't yet implemented this, I'm still in the thinking stage, but I have
I'm trying to figure out how to implement this relationship in coldfusion. Also if
I have a scenario that I need to implement. Namely, my server needs to
I'm thinking how to implement the producer/consumer pattern in Java. Assume that I have
Hi all I was wondering if there is a way to implement this method
I have a form page where users enter some data and upon hitting 'submit'
I'm trying to implement thinking-sphinx across multiple 'sites' hosted under a single rails application.
I'm thinking about using the java application object to implement a simple cache, to
I'm thinking sugest to my organization, to implement SVN for all users in my
Could mapreduce be used to implement a webserver? I'm thinking something like when a

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.