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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T10:36:51+00:00 2026-06-12T10:36:51+00:00

I have a jquery/bootstrap form. My php is checking against the database if an

  • 0

I have a jquery/bootstrap form. My php is checking against the database if an email address is already in use.

If the email address is in use, the following is called but to a new window.

echo'<p class="error">An account already exists for this email address. Please use a different email address</p>';

This all works fine but now I want the error message to show up on the Jquery form. I can’t seem to wrap my head around how to do this.

I know I have to use this handler, but I don’t know where to put the error message or how this code knows which error message to read from the php. Additionally, I would like the error message to show up next to the email field of the form

$(document).ready(function() {
    $('#form').submit(function() {
        $.ajax({
            type: 'POST',
            url: "process.php",
            data: dataString,
            success: function() {
            }
        })
        return false;
    });
});
  • 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-12T10:36:52+00:00Added an answer on June 12, 2026 at 10:36 am

    Processing the error message can be performed in the success property. The function can accept a data argument (the response from process.php).

    success: function(data){
        //does data contain p.error?
        //get the contents of p.error, display it on the current page
    
        //for example:
        if( $(data).find("p.error.name").length ){
            //process name error here
            nameError = $(data).find("p.error.name").text();
            console.log(nameError);
        }
        if( $(data).find("p.error.email").length ){
            //process email error here
            emailError = $(data).find("p.error.email").text();
            console.log(emailError);
        }
    }
    

    The success function defined above assumes process.php looks something like this:

    <div>
    <p class="error name">Please enter a name.</p>
    <p class="error email">Your email address is invalid.</p>
    
    <!-- some other stuff here -->
    </div>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have HTML which includes scripts in following order <script src=../static/js/jquery.js type=text/javascript> <script src=../static/js/bootstrap.js
JQuery Mobile, Bootstrap and CSS3 Media Queries What combination to use To have an
I'm encountering following problem with the twitter bootstrap framework and jQuery: I have the
I have the following jQuery source (modalConnect()) for loading a form and presenting it
ok, im using Jquery (edge) version, and bootstrap 2.0, and i have this code:
I have jQuery load asset on my layout and I want to use CHtml::ajaxButton/ajaxSubmitButton
I have JQuery UI Dialog opening on pressing CTRL + Q using the following
I have jquery tabs on my website but on smaller screens the tabs wrap
I have jQuery validation on my form. When I click submit button, 'save' function
I have jquery buttons in my website,but some of these buttons doesnt have to

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.