title: RequiredFieldValidator Not Working in ComboBox
body: <p>I think one common problem in using ComboBox is that the RequiredFieldValidator is not working properly on it.</p>
  
  <p>I also tried:
  1. CustomValidator
  2. CompareValidator</p>
  
  <p>But none of it is working. Please help.</p>
  
  <p>CompareValidator</p>
  
  <pre><code>&lt;asp:CompareValidator runat="server" ID="CompareFieldValidator1" 
  ErrorMessage="This field cannot be empty" ControlToValidate="CB_Operation" 
  ValueToCompare="-1" Operator="NotEqual"&gt;&lt;/asp:CompareValidator&gt;
  </code></pre>
  
  <p>RequiredFieldValidator</p>
  
  <pre><code> &lt;asp:RequiredFieldValidator ID="RequiredFieldValidator2"ControlToValidate="CB_Indication"
  runat="server" ErrorMessage="This field cannot be empty" Font-Names="Tahoma" Font-Size="Small"&gt;&lt;/asp:RequiredFieldValidator&gt;
  </code></pre>
  
  <p>Any ideas?</p>
  
  <p>UPDATE: Here is the mark-up of one of my ComboBoxes</p>
  
  <pre><code>&lt;asp:ComboBox ID="CB_Operation" runat="server" Font-Names="Tahoma" 
   Font-Size="Small" Width="170px" Font-Bold="True" 
  OnSelectedIndexChanged="CB_Operation_SelectedIndexChanged" AutoPostBack="True" InitialValue="0"&gt;
  
    &lt;asp:ListItem Value="0"&gt;Add&lt;/asp:ListItem&gt;
    &lt;asp:ListItem Value="1"&gt;Modify&lt;/asp:ListItem&gt;
    &lt;/asp:ComboBox&gt;     
  </code></pre>