Note that there are some explanatory texts on larger screens.

plurals
  1. POhow do I create a jQuery nTier select compare script?
    text
    copied!<p>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.</p> <p>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.</p> <p>If the prices don't match, I need to generate an alert...If the cases don't match I need to generate an alert.</p> <p>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. </p> <p>Here is a cleaned up simplified form that I am working with.</p> <pre><code>&lt;form name="form1" ID="form1"&gt; &lt;table&gt; &lt;tr&gt; &lt;td&gt; &lt;select name="selectA"&gt; &lt;option id="A" value=""&gt;None&lt;/option&gt; &lt;option id="A" value="A"&gt;A&lt;/option&gt; &lt;option id="A" value="B"&gt;B&lt;/option&gt; &lt;option id="A" value="C"&gt;C&lt;/option&gt; &lt;/select&gt; &lt;/td&gt; &lt;td&gt; &lt;input id="priceA" type="text" name="price" value="8.99"&gt; &lt;/td&gt; &lt;td&gt; &lt;input id="perCaseA" type="text" name="perCase" value="4"&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; &lt;select name="selectB"&gt; &lt;option id="B" value=""&gt;None&lt;/option&gt; &lt;option id="B" value="A"&gt;A&lt;/option&gt; &lt;option id="B" value="B"&gt;B&lt;/option&gt; &lt;option id="B" value="C"&gt;C&lt;/option&gt; &lt;/select&gt; &lt;/td&gt; &lt;td&gt; &lt;input id="priceB" type="text" name="price" value="8.99"&gt; &lt;/td&gt; &lt;td&gt; &lt;input id="perCaseB" type="text" name="perCase" value="4"&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/form&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload