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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:17:37+00:00 2026-05-26T07:17:37+00:00

I am working with jQuery on trying to creating a match/mismatch alert. Basically I

  • 0

I am working with jQuery on trying to creating a match/mismatch alert. Basically I have an nTier series of drop downs and input fields.

If a user drops down the select and chooses a value and that value matches another select group drop down. I then need to go and compare the price and perCase values and make sure there is a match.

If the prices don’t match, I need to generate an alert…If the cases don’t match I need to generate an alert.

I can do two, but I need this to aggregate and persist over an nTier amount of select/price/case groups and I am getting confused on how to do this.

Here is a cleaned up simplified form that I am working with.

<form name="form1" ID="form1">
<table>
<tr>
<td>
    <select name="selectA">
        <option id="A" value="">None</option>
        <option id="A" value="A">A</option>
        <option id="A" value="B">B</option>
        <option id="A" value="C">C</option>
    </select>
</td>
<td>
    <input id="priceA" type="text" name="price" value="8.99">
</td>
<td>
    <input id="perCaseA" type="text" name="perCase" value="4">
</td>
</tr>
<tr>
<td>
    <select name="selectB">
        <option id="B" value="">None</option>
        <option id="B" value="A">A</option>
        <option id="B" value="B">B</option>
        <option id="B" value="C">C</option>
    </select>
</td>
<td>
    <input  id="priceB" type="text" name="price" value="8.99">
</td>
<td>
    <input  id="perCaseB" type="text" name="perCase" value="4">
</td>
</tr>
</table>
</form>
  • 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-26T07:17:37+00:00Added an answer on May 26, 2026 at 7:17 am

    I was sure this should be possible just using jQuery selectors, but not quite. Ah well. 🙂

    This selects all of the select elements and then filters then by checking their values against the triggering select (apparently xxx[value="xx"] doesn’t work for select). The input following any matching selects (the price textbox) is then filtered to make sure it doesn’t have the same value as the triggering select‘s following input. If you still get matches, you have an inconsistency and need an alert.

    The rather ugly parent().next().children() is unfortunately needed because of the table.

    You’ll need an analogous bit of code for the per case, um, case. I don’t think you can check both at once unfortunately.

    $("select").change(function ()
    {
        var $this = $(this);
    
        if ($("select").filter(function () { return $(this).val() == $this.val(); }).parent().next().children("input[value!='" + $this.parent().next().children("input").val() + "']").length != 0)
        {
            // alert
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to validate the form fields by creating my own jquery function
I've been working with jQuery and *.asmx web services lately, and I'm trying to
I am trying to get this awesome JQuery plugin working with SQL Server. I
I'm trying to build a horizontal accordion with Jquery. It seems to be working
I'm working on an interactive interface using SVG and JavaScript/jQuery, and I'm trying to
So, I'm working with CKEditor and jQuery, trying to build a pop-out editor. Below
I'm working with jQuery for the first time and need some help. I have
I am working with JQuery and I'm trying to change the html of a
I'm working with jQuery Mobile, trying to unbind hover from links – long story
I have jquery working in my Richfaces 3.3.3 application. I added the following to

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.