Hi all,
i have come confusion, how can we achieve this goal
for example, i have a dropdown, which the item is HR, Admin, IT
eg : <asp:DropDownList ID="DropDownList22" runat="server" OnSelectedIndexChanged="DropDownList22_SelectedIndexChanged" AutoPostBack="true" >
<asp:ListItem>IT</asp:ListItem>
<asp:ListItem>Admin</asp:ListItem>
<asp:ListItem>HR</asp:ListItem>
</asp:DropDownList>
so, i want to put my validation here in date textbox, only if user select IT, this textbox will validate, for other (Admin and HR) they can left the date empty
<asp:TextBox ID="TextBox32" runat="server" AutoPostBack="true" OnTextChanged="TextBox32_TextChanged"></asp:TextBox>
what kind of validator can i use and how are the validator can be made?
i already try put requiredvalidator, but if i select admin and left the field empty, i got the errormessage too.
<asp:RequiredFieldValidator ID="chkDateReturn" runat="server" ControlToValidate="TextBox32" ErrorMessage="Must select the return date" ></asp:RequiredFieldValidator>
thanks