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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T16:24:44+00:00 2026-06-07T16:24:44+00:00

email1: { required: true, blacklist: true, beanEmailValidator: true, minlength: 6, maxlength: 70, remote: {

  • 0
email1: {
                    required: true,
                    blacklist: true,
                    beanEmailValidator: true,
                    minlength: 6,
                    maxlength: 70,
                    remote: {
                        type: "GET",
                        url: llbFieldValJSONURL,
                        data: {
                              fieldData : function() {
                                return $("#enterEmail").val();
                              }                           
                         },
                        dataType:"json",
                        dataFilter: function(data) {
                            var json = jQuery.parseJSON(data);
                            if(json.error == "true") {
                                return "\"" + json.errorMessage + "\"";
                            } else {
                                return success;

                            }

                        }
                    }

                }

This function check the uniqueness of a username and returns an error if not unique. The issue is that the remote method won’t make any additional calls after being valid.. I need it to trigger every time a value is entered/changed.

For example, if I enter 3 non-unique usernames, the call is made every time. If I enter a unique username, the call is made correctly and the username comes back as valid. So the field is then valid. Now if I enter another non-unique (invalid) username, the remote method won’t trigger again.

Wondering if it’s somehow caching the response?

invalid (non-unique) response:

{"error":"true","errorMessage":"<b>The User Name you chose is already in use.</b>  Please enter another name."}

valid (unique) response:

{"error":"false","errorMessage":""}

Edit

Saw this on SO:

https://stackoverflow.com/a/1821667/335514

$("#site").change(function() {
  $("#email").removeData("previousValue");
});

So the plugin seems to be caching the response. Does the plugin have a method to switch off caching, or would adding a cache: false to the ajax call do the same thing?

Edit

Neither of these methods worked. It appears that once a field is marked valid, it won’t make the remote call again. Thoughts on how to fix? Would putting the function into it’s own addMethod prevent this scenario?

  • 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-07T16:24:45+00:00Added an answer on June 7, 2026 at 4:24 pm

    UPDATE/SOLUTION:

    Looking at the source code of jquery.validate.js, particularly this snippet:

    success: function(response) {
        validator.settings.messages[element.name].remote = previous.originalMessage;
        var valid = response === true;
    
        if ( valid ) {   ...
    

    Since the response is evaluated as JSON, you are expected to call return "true". This is also pointed out in the documentation

    “The response is evaluated as JSON and must be true for valid elements”

    However, it can be quite confusing when looking at the source code that does an exactly equals test for true, if you neglect the fact that the following is implicitly set dataType: json

    end update


    Upon investigating some more, I’d say that your ‘dataFilter’ should not be returning ‘success’

    Refer to Callback function queues @ http://api.jquery.com/jQuery.ajax/

    dataFilter callback is invoked immediately upon successful receipt of
    response data. It receives the returned data and the value of
    dataType, and must return the (possibly altered) data to pass on to
    success.

    My guess is that your JS breaks on trying to do return success and thus no further validation requests are sent

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

Sidebar

Related Questions

My jQuery code is: $(document).ready(function(){ $('#StudentRegisterForm').validate({ rules: { email: { required:true, email:true } }
$(document).ready( function(){ $(#form1).validate( { rules: { email: { // compound rule required: true, email:
I have a model like this: class Users(db.Model): email = db.EmailProperty(required=True, indexed=True) user_name =
I have this code here: $(#order).validate({ rules: { name: { required: true } lastname:
I have the following code: JS <script type=text/javascript> $(function(){ $('#fgotpwfield').hide(); $('#login_submit').click(function() { $('#form_result').fadeOut('fast'); $('#myccrxlogin
I've got a form that has 2 required fields (email and message) and 2
Considers me@there valid. Is not a TLD required? try { foreach (var email in
I have a painfully simple view model public class TellAFriendViewModel { public string Email1
class SupportMailer < ActionMailer::Base default :from => email1@gmail.com def welcome_email(ticket) case ticket.game when gameone
JS: The JS for client side validation of email field <script type=text/javascript src=http://code.jquery.com/jquery-latest.min.js> </script>

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.