title: JQuery Validation Help
body: <p>I need help validating a form, preferably using JQuery:</p>
  
  <p>this is my code:</p>
  
  <pre><code>&lt;form action='index.php' method='post'&gt; 
  &lt;table&gt; 
  &lt;tr&gt; 
    &lt;td&gt;1.&lt;/td&gt; 
    &lt;td&gt;&lt;select name='from_1'&gt;&lt;option&gt;HOME&lt;/option&gt;&lt;option&gt;A&lt;/option&gt;&lt;option&gt;B&lt;/option&gt;&lt;option&gt;C&lt;/option&gt;&lt;/select&gt;&lt;/td&gt; 
    &lt;td&gt;&lt;select name='to_1'&gt;&lt;option&gt;HOME&lt;/option&gt;&lt;option&gt;A&lt;/option&gt;&lt;option&gt;B&lt;/option&gt;&lt;option&gt;C&lt;/option&gt;&lt;/select&gt;&lt;/td&gt; 
  &lt;/tr&gt; 
  &lt;tr&gt; 
    &lt;td&gt;2.&lt;/td&gt; 
    &lt;td&gt;&lt;select name='from_2'&gt;&lt;option&gt;HOME&lt;/option&gt;&lt;option&gt;A&lt;/option&gt;&lt;option&gt;B&lt;/option&gt;&lt;option&gt;C&lt;/option&gt;&lt;/select&gt;&lt;/td&gt; 
    &lt;td&gt;&lt;select name='to_2'&gt;&lt;option&gt;HOME&lt;/option&gt;&lt;option&gt;A&lt;/option&gt;&lt;option&gt;B&lt;/option&gt;&lt;option&gt;C&lt;/option&gt;&lt;/select&gt;&lt;/td&gt; 
  &lt;/tr&gt; 
  &lt;tr&gt; 
    &lt;td&gt;3.&lt;/td&gt; 
    &lt;td&gt;&lt;select name='from_3'&gt;&lt;option&gt;HOME&lt;/option&gt;&lt;option&gt;A&lt;/option&gt;&lt;option&gt;B&lt;/option&gt;&lt;option&gt;C&lt;/option&gt;&lt;/select&gt;&lt;/td&gt; 
    &lt;td&gt;&lt;select name='to_3'&gt;&lt;option&gt;HOME&lt;/option&gt;&lt;option&gt;A&lt;/option&gt;&lt;option&gt;B&lt;/option&gt;&lt;option&gt;C&lt;/option&gt;&lt;/select&gt;&lt;/td&gt; 
  &lt;/tr&gt; 
  &lt;/table&gt; 
  &lt;input type='submit' value='submit' /&gt; 
  &lt;/form&gt;
  </code></pre>
  
  <p>I want to add some javascript <b>validation</b>:<br>
  when someone clicks on the submit button, the form should be validated (see below).<br> When it is invalid, an error message should popup (alert or -even better- modal dialog), and the form should not be submitted.</p>
  
  <p><b>The validation:</b><br>
  each row (in this example 3, but could be more) should contain one and only one time the 'HOME' selection. So either the 'from' or the 'to' option should be HOME.</p>
  
  <p>Can someone help me with this? I know it is quite specific, but it will help me a lot...</p>