CustomValidator Needed

Last post 06-30-2009 8:03 PM by MetalAsp.Net. 1 replies.

Sort Posts:

  • CustomValidator Needed

    06-30-2009, 4:19 PM

    If a user selects "Evening" then the RadDate1 is required.  What is the best way to go about this?  
    <asp:DropDownList ID="DropDownListTime" AutoPostBack="true" runat="server">
               <asp:ListItem Text="Not Set" Value="0" />
               <asp:ListItem Text="Morning" Value="1" />
               <asp:ListItem Text="Evening" Value="2" />
    </asp:DropDownList>  
     
    <telerik:RadDatePicker ID="RadDate1" runat="server" >
              <DateInput ID="DateInput1" Font-Size="8pt" runat="server" /> 
    </telerik:RadDatePicker> 
    


     
    "From my point of view, the Jedi are evil!"
  • Re: CustomValidator Needed

    06-30-2009, 8:03 PM

    Use a RequiredFieldValidator for the date control, and set it Enabled="False".  Now handle the SelectedIndexChanged event of the DDL, and if the selectedvalue is 2, enable the validator, otherwise disable it.

Page 1 of 1 (2 items)