Check the value of multiple element with the same class name
<p>I have 7 dropdown with the class name="dd". and i have 7 textbox with the class name ="tt". each text box corresponds to each dropdown.
now, i have to check </p>

<pre><code>if(dropdown value is equal to 1)
    text box can not be empty.
</code></pre>

<p>so to do this what i am doing:</p>

<pre><code>function checkOpenHours() {
        if ($('.dd').val() == 1 &amp;&amp; $('.tt').val() == "") {

                alert("Please select an opening hour.");
                return false;

        }
    }
</code></pre>

<p>and i am calling this function like </p>

<pre><code>&lt;asp:Button ID="btnSave" runat="server" Text="Update hour" Height="35px" 
        onclick="btnSave_Click" OnClientClick="return checkOpenHours()"/&gt;
</code></pre>

<p>BUT The problem is, this only works for the first dropdown and textbox.
It does not work for the other 6 dropdown and textbox ..!!</p>

<p>what am i doing wrong?? any help?</p>
