How to find dropdownlist value inside javascript
<p>I have one <code>master page</code> and Below is one <code>content page'</code>s code..I am not able to find <code>dropdownlist dpbatchname</code> 's value inside javascript..i am new to <code>javascript</code> plz,help i want to validate textbox value based on that <code>dropdownlist</code> value..      </p>



<pre><code>   &lt;asp:Content ID="Content1" ContentPlaceHolderID="Contentplaceholder2" Runat="Server"&gt;
   &lt;script  type="text/javascript" language="javascript"&gt;
       function ClientValidate(source, arguments) {
           var ddl = document.getElementById("dpbatchname");
           if (ddl.value.length == 2) {
                   arguments.IsValid = true;
               }
               else {
                   arguments.IsValid = false;
               }
           }

   &lt;/script&gt;

       &lt;div&gt;
               &lt;table style="width: 100%; background-color:Silver"  border="1"&gt;

                &lt;td align="right" width="50%" valign="top"&gt;
                           &lt;asp:Label ID="Label3" runat="server" Text="Select Batch:" 
                               Font-Underline="False" ForeColor="#FF3300"  Font-Bold="True" Font-Size="Larger"&gt;&lt;/asp:Label&gt;
                       &lt;/td&gt;
                       &lt;td width="50%" valign="top"&gt;
                           &lt;asp:DropDownList ID="dpbatchname" runat="server" AutoPostBack="True" 
                               DataSourceID="SqlDataSource5" DataTextField="batch_name" 
                               DataValueField="batch_name" Width="119px" Height="33px"&gt;
                           &lt;/asp:DropDownList&gt;
  &lt;asp:TextBox ID="tbnooflecture" runat="server"  Width="113px" Height="33px"&gt;&lt;/asp:TextBox&gt;
       &lt;asp:CustomValidator id="CustomValidator1" ControlToValidate="tbnooflecture"    ClientValidationFunction="ClientValidate"
     ValidationGroup="upper" Display="Static" ErrorMessage="Not an even number!" ForeColor="green" Font-Name="verdana"    Font-Size="10pt"
      runat="server"/&gt;

                     &lt;/td&gt;
       &lt;/tr&gt;
       &lt;/div&gt;
</code></pre>
