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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T00:56:06+00:00 2026-06-05T00:56:06+00:00

I have a PHP script that checks an email address to determine if it

  • 0

I have a PHP script that checks an email address to determine if it is valid or not. The function simply returns true or false. I am trying to implement an ajax call to the php file and return the true or false back to the javascript function. Currently I am getting nothing.

function validateForm() {
    var email = document.forms["contact"]["email"].value;
    var validEmail;

    $.ajax({
        type: "POST",
        url: "validateEmail.php",
        data: "email=" + email,
        success: function(result) {
            validEmail = result;
            console.log('result: ' + validEmail);
        }
    });
}

If I can retrieve the true or false I will then do some boolean checking to determine how to proceed. The function validateForm() is being called when the user clicks a form Submit button.

<form name="contact" action="submitOrder.php" onsubmit="return validateForm();" method="post">

I’d like the validateForm() function to return false if the email address is not valid so that submitOrder.php is never called but due to the asynchronous nature of AJAX, I am not sure how to do this.

UPDATE

The request is working correctly (I’m pretty sure). This is what I am seeing in Firebug.
enter image description here
I’m still not seeing anything returned. The console prints “result: “. I also changed validateEmail.php to return the number 17 and I still get nothing returned.

Thanks for any help!

  • 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-05T00:56:08+00:00Added an answer on June 5, 2026 at 12:56 am

    Use JQuery Validate plugin. Would be a lot simpler then hashing this out from scratch.

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

Sidebar

Related Questions

I have a PHP script that processes my email subscriptions. It does something like:
We have a cron'ed PHP script that checks an inbox every ten minutes. The
I have a php script that check if the referrer has been cleared after
I have php script that creates a temporary watermark image for users that are
I have PHP web script that have to be executed periodically, using web browser.
I have a PHP script that deletes files. It can delete files from my
I have a php script that takes a file's id in the url, finds
I have a php script that limits the amount of times people can download
I have a php script that uses curl_multi to make multiple requests at the
I have a php script that gets user input (some text and a link),

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.