TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Renjith V S
NA
317
65.7k
How to use more than one validator on button click ?
May 16 2014 12:42 AM
Hi,
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.
My javascript code is:
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.
Reply
Answers (
2
)
How to add value into DropDownList within GridView?
Translate website into Hindi