2

I am using the jQuery MVC validation library for ASP.NET MVC, which is working fine.

However, on my form I have a 'Cancel' and a 'Save' button, both of which I want to submit the form back to the server.

However, if the user clicks 'Cancel' I need to disable the client side validation so that the user doesn't get prompted to complete required fields before they can cancel!

Any pointers would be appreciated!

Thanks.

Chris Roberts
  • 18,622
  • 12
  • 60
  • 67

2 Answers2

0

I found a solution if you still have the same problem : step by step problem with validation on "back" button

Hope this helps!

Community
  • 1
  • 1
VinnyG
  • 6,883
  • 7
  • 58
  • 76
0

So, when the user clicks cancel, what exactly you are expecting to happen? If you want to just redirect to a different page, then make sure the "cancel" button type is not submit and onclick of the cancel button, redirect to a different page. Button click will not validate the fields if it is not of submit type.

SKumar
  • 1,227
  • 6
  • 18
  • 29