Click here to Skip to main content
15,881,687 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi Developers,

I have one form, some of the fields are mandatory. Am using required field validator.
i have two buttons Submit and Clear. So when i use required field validator,it shows error message when i click on clear button. i want to fire that validator only when i click submit button
How to do this?
Posted
Comments
Kumarbs 18-Aug-14 8:49am    
Do you have "ValidationGroup" property to clear button, if so remove it.
Am Gayathri 18-Aug-14 8:51am    
I got it. Thanks fr ur reply.

1 solution

Set CausesValidation property to false for clear button
C#
<asp:Button ID="btnClear" runat="server" Text="Clear" CausesValidation="false" />
 
Share this answer
 
v2
Comments
Am Gayathri 18-Aug-14 8:51am    
Thanks
pradiprenushe 18-Aug-14 13:24pm    
welcome

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900