How to check this form properly filled out in an easier way?
<p>I have a questionnaire of which one question offers five answer options. The user may tick three, and give those three a rating. To avoid misunderstanding, here is the HTML code: </p>

<pre><code>&lt;table&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;input type="checkbox" name="option_1"&gt; Option 1 (to be determined)&lt;/td&gt;
        &lt;td&gt;
            &lt;select name=""&gt;
                &lt;option value=""&gt;as:&lt;/option&gt;
                &lt;option value="3"&gt;1st&lt;/option&gt;
                &lt;option value="2"&gt;2nd&lt;/option&gt;
                &lt;option value="1"&gt;3rd&lt;/option&gt;
            &lt;/select&gt;
        &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;input type="checkbox" name="option_2"&gt; Option 2 (to be determined)&lt;/td&gt;
        &lt;td&gt;
            &lt;select name=""&gt;
                &lt;option value=""&gt;as:&lt;/option&gt;
                &lt;option value="3"&gt;1st&lt;/option&gt;
                &lt;option value="2"&gt;2nd&lt;/option&gt;
                &lt;option value="1"&gt;3rd&lt;/option&gt;
            &lt;/select&gt;
        &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;input type="checkbox" name="option_3"&gt; Option 3 (to be determined)&lt;/td&gt;
        &lt;td&gt;
            &lt;select name=""&gt;
                &lt;option value=""&gt;as:&lt;/option&gt;
                &lt;option value="3"&gt;1st&lt;/option&gt;
                &lt;option value="2"&gt;2nd&lt;/option&gt;
                &lt;option value="1"&gt;3rd&lt;/option&gt;
            &lt;/select&gt;
        &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;input type="checkbox" name="option_4"&gt; Option 4 (to be determined)&lt;/td&gt;
        &lt;td&gt;
            &lt;select name=""&gt;
                &lt;option value=""&gt;as:&lt;/option&gt;
                &lt;option value="3"&gt;1st&lt;/option&gt;
                &lt;option value="2"&gt;2nd&lt;/option&gt;
                &lt;option value="1"&gt;3rd&lt;/option&gt;
            &lt;/select&gt;
        &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;input type="checkbox" name="option_5"&gt; Option 5 (to be determined)&lt;/td&gt;
        &lt;td&gt;
            &lt;select name=""&gt;
                &lt;option value=""&gt;as:&lt;/option&gt;
                &lt;option value="3"&gt;1st&lt;/option&gt;
                &lt;option value="2"&gt;2nd&lt;/option&gt;
                &lt;option value="1"&gt;3rd&lt;/option&gt;
            &lt;/select&gt;
        &lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;
</code></pre>

<p>I need to be able to check that the user did not tick more than three options, and that the ratings 1st, 2nd and 3rd are only used once. I can check that with a javascript that checks each item separately, like this: </p>

<pre><code>if (document.form_name.option_1.value != "") &amp;&amp; 
(document.form_name.option_2.value != "") &amp;&amp; 
(document.form_name.option_3.value != "") &amp;&amp; 
(document.form_name.option_4.value != "") 
{alert('You can only tick three options'); return false};
</code></pre>

<p>but that would give a humongous script. Is there an easier way? It may be javascript or PHP. Preferably the latter, but I am not as proficient in PHP, so then I would need a rather ready-to-use script. </p>

<p>Thanks much in advance.  </p>
