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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T16:27:06+00:00 2026-06-11T16:27:06+00:00

So I was looking at some code I wrote a few days ago, it

  • 0

So I was looking at some code I wrote a few days ago, it works perfectly, and I have absolutely no idea how. I was hoping one of you could help me out.

In my validation code, I am performing some ajax requests. This is done using the “remote” tag. These requests send the username and emails that were entered in a form to the server.

 $("#signup-form").validate({
    rules: {
        username: {
            required: true,
            remote: {
                url: "/CheckDuplicateUsername/",
                type: "get",
                data: { 
                    username: $("#username").val()
                }
            }
        },

        email: {
            required: true,
            remote: {
                url: "/CheckDuplicateEmail/",
                type: "get",
                data: { 
                    email : $("#email").val()
                }
            }
        },
//More code

Note that I send the values inside the email and username fields to the server. I get these values using an ID. I think I am getting this data from the form’s tags. Now let me show you my HTML. Notice that the ID in my username and password tags is different than the ID used in my jQuery code above.

<div class="fieldWrapper">

              <label for="id_username">Username: </label>
              <input id="id_username" type="text" placeholder="First Name" name="username" maxlength="30" class="valid">
           </div>

<div class="fieldWrapper">

                <label for="id_email">Email</label>
                <input id="id_email" type="text" placeholder="Email" name="email" maxlength="75">
           </div>

My two input tags have the ids “id_username” and “id_email”, respectively. But the validation code selects the tag with the ids “username” and “email”. Note that my validation code is sending the right data to the server. If I try to change the validation code to select the value inside the tags associated with the “id_username” and “id_email,” null strings are sent to the server. How can this be!?

Thank you!

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

    When you have

    rules: {
            username: {
    ...
    

    That means validate field that has name attribute equal username. When you specify remote option you can use data for sending data for additional field. Like in this example from plugins docs:

    “Makes the email field required, an email and does a remote request to
    check if the given address is already taken. In addition, the http
    method is set to “post” and the username is sent along side the email
    address.”

    $("#myform").validate({
      rules: {
        email: {
          required: true,
          email: true,
          remote: {
            url: "check-email.php",
            type: "post",
            data: {
              username: function() {
                return $("#username").val();
              }
            }
          }
        }
      }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am testing some weird-looking CSS code that I wrote (I'm using a mix
I am looking to write some pseudo-code of a recursive descent parser. Now, I
while looking at some code I stumbled onto: throw /*-->*/new std::exception (//... and I
I was looking at some code a friend sent me, and he said: It
I was looking at some code in Python (I know nothing about Python) and
I'm looking at some code that creates a mutable data object and puts a
I'm looking for some code (C# or VB.NET preferred) to iterate through all folders
I'm looking at some code which should be trivial -- but my math is
I am looking at some code (Delphi 7) with following check is at the
I'm looking through some code for learning purposes. I'm working through this portion 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.