I have 2 text boxes and 3 drop down lists as mandatory fields. I am using javascript and asp .net validator for validation. When I click on the submit button all the 5 validator should work. But in my code only one validator is working.
var Page_IsValid = false;
Page_IsValid =Page_ClientValidate('valgrpCode');
Page_IsValid = Page_ClientValidate('valgrpDescription');
Page_IsValid = Page_ClientValidate('valgrpCategory');
and my asp code is:
<asp:RequiredFieldValidator ID="reqCode" runat="server" ErrorMessage="*" ControlToValidate="txtCode" ValidationGroup="valgrpCode" ForeColor="Red"></asp:RequiredFieldValidator>
<asp:RequiredFieldValidator ID="reqDescription" runat="server" ErrorMessage="*" ControlToValidate="txtDescription" ValidationGroup="valgrpDescription" ForeColor="Red"></asp:RequiredFieldValidator>
<asp:RequiredFieldValidator ID="reqCategory" runat="server" ErrorMessage="*" ControlToValidate="txtCategory" ValidationGroup="valgrpCategory" ForeColor="Red"></asp:RequiredFieldValidator>
and also here i am showing "*" as mandatory message. But I need to change the color of label as mandatory message. I have added labels for each text boxes and drop down lists.