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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T15:06:43+00:00 2026-05-14T15:06:43+00:00

I have a form in which I am using remote validation to check if

  • 0

I have a form in which I am using remote validation to check if an email address already exists in the database. However, the catch is that on this form, the user can select between several different “groups”, and each group has its own distinct set of email addresses (thus the same email can exist once in each group).

The group selection is a dropdown on the form, and the email address is an input field with remote validation. I have a couple issues. First, I have set up my remote rule like this:

remote: {
    url: 'remote_script.php',
    data: {  group_id:  $('select.group_id').val() }
}

However, this seems to statically set the group_id parameter to whatever the first value in the select is. Meaning, if I change the select, then trigger the remote validation again, the group_id parameter does not change

First, how can I make this parameter dynamic, depending on the value of a select in the form?

Secondly, how do I manually trigger the remote validation on the email address field? When the group_id select is changed, I want to re-trigger the remote validation on the email address field (without changing the value of the field). I tried using

$(selector).validate().element('.email_addr')

But this appears to only trigger the standard validation (required, email), and not the remote call.

  • 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-14T15:06:44+00:00Added an answer on May 14, 2026 at 3:06 pm

    Found the solution to the second part of my question:

     $(".email_addr").removeData("previousValue");
    

    will remove the cache of the remote request, and allow the remote request to be triggered again, using .element().

    Thus my code is as follows:

    $("select.group_id").change(function() {
        $(".email_addr").removeData("previousValue"); //clear cache when changing group
        $("#customer_form").data('validator').element('.email_addr'); //retrigger remote call
        //my validator is stored in .data() on the form
    });
    

    Solution was found here: solution

    The first part of my question was answered originally by @Jeffery To

    All that needs to be done is to change the value of the parameter to a function, rather than just a value. Jeffery’s example is copied below for future googlers:

    remote: {
      url: 'remote_script.php',
      data: {
        group_id: function () {
            return $('select.group_id').val();
        }
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a form which is used to insert/display and update . In the
I have a form which takes both the user details and an image uploaded
I have a form which has a lot of SELECTs. For various reasons, I'd
In my Rails app, I have a form which redirects through a foreign service,
I have a form in which people will be entering dollar values. Possible inputs:
I have a form in which the user can choose a component type from
I have a C# form into which I've placed a left-docked MenuStrip . This
I have a an HTML form which contains the YAHOO rich text editor on
I have CustomForm inherited from Form which implements a boolean property named Prop .
I have a relatively simple form which asks a variety of questions. One of

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.