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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T11:47:28+00:00 2026-06-10T11:47:28+00:00

After I type the input the textbox shows again in and I don’t know

  • 0

After I type the input the textbox shows again in and I don’t know how to fix. Here’s the screen shot of the output:

enter image description here

Is shows again after the on blur

Here’s my code, and I don’t know how to fix this. though my function works well

<!DOCTYPE HTML>
    <html lang="en">
    <head>
        <meta charset="utf-8">
        <title>Amateur</title>
        <link rel="stylesheet" href="css/reset.css" type="text/css">
        <script src="http://code.jquery.com/jquery-1.8.0.js"></script>
        <script>
            function check_email() {
                var email=$("#txtEmail").val();
                $.ajax(
                {
                    type:"POST",
                    url:"index.php",
                    data: "email="+email,
                    success:function(msg) {
                        $("#chkEmail").html(msg);
                    }
                });
                return false;
            }
        </script>
    </head>

    <body>
    <form method="post">
        <label for="txtEmail">E-mail:</label>
            <input id="txtEmail" name="email" type="email" onblur="return check_email()">
        <label id="chkEmail" for="txtEmail"></label>
        <?php
        if(isset($_POST['email']))
        {
            $user='root';

            $pdo=new PDO('mysql:host=localhost;dbname=class;charset=utf8',$user);

            $email=$_POST['email'];

            $stmt=$pdo->prepare('SELECT user_email from tbl_users WHERE user_email=:email LIMIT 1');
            $stmt->execute(array(':email'=>$email));

            if($stmt->rowCount()>0) {
                echo 'E-mail already use.';
            }
            else {
                echo 'E-mail not use.';
            }   
        }
        ?>
    </form>
    </body>
    </html>
  • 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-10T11:47:30+00:00Added an answer on June 10, 2026 at 11:47 am

    Change your code like this. The issue is you POST the data to the same page your are in and you get the whole code as the response for you AJAX request. So if you exit the execution on POST you will only get the relevant message.

     <?php
            if(isset($_POST['email']))
            {
                $user='root';
    
                $pdo=new PDO('mysql:host=localhost;dbname=class;charset=utf8',$user);
    
                $email=$_POST['email'];
    
                $stmt=$pdo->prepare('SELECT user_email from tbl_users WHERE user_email=:email LIMIT 1');
                $stmt->execute(array(':email'=>$email));
    
                if($stmt->rowCount()>0) {
                    echo 'E-mail already use.';
                }
                else {
                    echo 'E-mail not use.';
                } 
                exit;  
            }
            ?><!DOCTYPE HTML>
        <html lang="en">
        <head>
            <meta charset="utf-8">
            <title>Amateur</title>
            <link rel="stylesheet" href="css/reset.css" type="text/css">
            <script src="http://code.jquery.com/jquery-1.8.0.js"></script>
            <script>
                function check_email() {
                    var email=$("#txtEmail").val();
                    $.ajax(
                    {
                        type:"POST",
                        url:"index.php",
                       data: { 
                'email': email
                    },
                        success:function(msg) {
                            $("#chkEmail").html(msg);
                        }
                    });
                    return false;
                }
            </script>
        </head>
    
        <body>
        <form method="post">
            <label for="txtEmail">E-mail:</label>
                <input id="txtEmail" name="email" type="email" onblur="return check_email()">
            <label id="chkEmail" for="txtEmail"></label>
    
        </form>
        </body>
        </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In a TextBox input. After type enter key, i want to hide soft keyboard.
I'm showing a spinning wheel image when users type in a textbox and after
After I run, when I type the value in Username textbox and clicked submit
Here is what I have: the input type text boxes are dynamically rendered from
I'm using the simple code below to replace a textbox ( <input type=text />
Would be possibile to get the original data type after applying the ArrayToStringTransformer to
After defining the following : abstract class A { type T def print(p: T)
After doing some experimentation with move semantics with an array type I created, I
I have bug with UIImagePickerController which source type is camera. Sometimes after controller appeared,
I got this url /search/renttype-all.place-all.type-all.bedrooms-all.0.0/ I want to get the text after the second

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.