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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T20:15:59+00:00 2026-05-23T20:15:59+00:00

his form is working with the required and email check, however, when I do

  • 0

his form is working with the required and email check, however, when I do remote, it is giving really weird responses.
I’m not totally sure I’m returning the right thing from my php. When I set it to return the variables, it will just put up the first checked value and say it already exists, even though it doesn’t, and leave it there even when I change the input.. I tried echoing the value in the php, though so I know it’s getting the right values. And If I echo out the $valid variable instead of returning it, the message gets set to ‘1’ and stays like that whether there’s a match or not.

Not sure what I’m doing wrong here, it seems to be fairly straightforward, but it may be that I’m not understanding what’s supposed to be passed through the JSON. Let me know what you think, I’ve run out of things to try!

 $(function() { 
    $("#registrationForm").validate({ 
        rules: { 
            email: {  
                required: true, 
                email: true, 
                remote: "checkEmail.php" 
            }
        }
 messages: { 
             email: { 
                 required: "This field is required", 
                 email: "Please enter a valid email address", 
                 remote: jQuery.format("{0} is already in use") 
             }
         }
    }); 
 }); 

The php:

$check = trim(strtolower($_GET['email']));
$valid = true;
foreach ($model->getAllUsers() as $users) {
   if ($users->email == $check) {
       $valid = false;
   } 
}
return $valid;
  • 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-23T20:15:59+00:00Added an answer on May 23, 2026 at 8:15 pm

    The solution is to use echo json_encode($valid); as the output. It mentioned JSON encode in the documentation, but I guess it threw me off that the example php they had did not use it.

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

Sidebar

Related Questions

I am working on a contact form that is not posting my multiple selection
I'm trying to set a #default_value on my D7 form, but it's not working...
I have a user submission form, and the user supplies his name and email.
I have a contact us form, whereby the user enters his name,email address and
Noobie muddling his way through an Ajax autosuggest form: I've got most of it
A friend has pointed me to his old website and says the submit form
I have a working example of a form here . I need to use
I'm working with yii framework forms and I have a form like this: <?php
A coworker of mine was working on preventing duplicate form submissions (on a successful
So I have a Facebook registration plugin on my site that is working really

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.