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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T15:52:30+00:00 2026-05-21T15:52:30+00:00

I know there have been posts that are almost the same thing I have

  • 0

I know there have been posts that are almost the same thing I have looked through alot of them and sadly have not found a solution. My problem is that I wrote a email valiadtor using jquery’s .addmethod() function to the jquery validation plugin.

$.validator.addMethod("uniqueEmail", function(value, element) {
    $.ajax({
        data: 'email=' + value,
        type: 'get',
        url: 'functions/emailcheck.php',
            dataType:"html",
            success: function(msg) {
                alert("M:"+msg+"   V:"+value);
                if(msg == true || msg != null || msg == "true"){
                    return true;
                    alert("TRUE!!!");
                }
                else{
                    return false;
                }
            }
        });
    });

Then in the validation rules…

email: { required: true, email: true, uniqueEmail: true },

Then finally even during with this php file….

<?php
    echo "true";
?>

It gives me the warning true has already been registered , with the message under email.. uniqueEmail: jQuery.format("{0} has already been registered"). Now I have a debugging alert set int he ajax call. it shows that it returns true, and the value is as entered.

I hope for some help this is driving me nuts and I have a feeling it’ll be obvious to some of you!

PS
heres my full Validation minus the above additional method…

$( ".form_registration_submit" ).click(function() {
        $(".qtip").remove();
        $("#form_registration").validate({
            onfocusout: function(element){
                $(".qtip").remove();
            },
            rules: {
                name: {
                    required: true,
                    minlength: 3
                },
                firstname: {
                    required: true,
                    minlength: 3
                },
                lastname: {
                    required: true,
                    minlength: 3
                },
                username: {
                    required: true,
                    minlength: 3
                },
                password: {
                    required: true,
                    minlength: 5
                },
                confirm_password: {
                    required: true,
                    minlength: 5,
                    equalTo: "#form_registration_password"
                },
                email: {
                    required: true,
                    email: true,
                    uniqueEmail: true
                },
                topic: {
                    required: "#newsletter:checked",
                    minlength: 2
                },
                agree: "required"
            },
            messages: {
                name: "Please enter your name",
                firstname: "Please enter your firstname",
                lastname: "Please enter your lastname",
                username: {
                    required: "Please enter a username",
                    minlength: "Your username must consist of at least 2 characters"
                },
                password: {
                    required: "Please provide a password",
                    minlength: "Your password must be at least 5 characters long"
                },
                confirm_password: {
                    required: "Please confirm your password",
                    minlength: "Your password must be at least 5 characters long",
                    equalTo: "Please enter the same password as above"
                },
                email: {
                    required: "Please enter a valid email address",
                    uniqueEmail: jQuery.format("{0} has already been registered")
                },
                agree: "Please accept our policy"
            },
             errorPlacement: function(error, element) {
              element.qtip(
                  {
                      show: { solo: false, ready: true, delay: 0 },
                      hide: { when:false },
                      content: eval(error),
                      style: { name: 'dark', border: { width: 1, radius: 1, color:"red" }, tip: 'bottomLeft' },
                      position: {
                          corner: { target: 'topRight', tooltip: 'bottomLeft' },
                          adjust: { x: 0 , y: 0 }
                      }
                  });
            },
            submitHandler: function(form) {
                $(".qtip").remove();
                jQuery(form).ajaxSubmit({
                    target: "#login_result"
                });
            }
        }); 
    });
  • 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-21T15:52:31+00:00Added an answer on May 21, 2026 at 3:52 pm

    Your validation function doesn’t actually return any value, hence evaluating to false. By default .ajax() requests are asynchronous, meaning that the validation function ends before there is a chance of executing your success callback.

    This issue is a duplicate of .post inside jQuery.validator.addMethod always returns false

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

Sidebar

Related Questions

I know there have been several posts about random word generation based on large
So I know there have been a couple of posts around about this topic,
I know there have been a few threads on this before, but I have
I know there have been questions in the past about SQL 2005 versus Lucene.NET
OK, I know there have already been questions about getting started with TDD ..
I know there have been a ton of questions about how to implement automatic
I have two keyboards connected to my PC, is there any way to know
Problem, there's no method: bool ChangePassword(string newPassword); You have to know the current password
I know there is a function somewhere that will accept a client rect and
Ok, I have a question that I know is very opinionated (based on all

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.