Client validate in MVC 2
- by khoailang
Hello, I'm very new in MVC 2,
Let say, I have a page with 1 text box and 2 input typed submit, "back" and "next".
I'm using client validation like this:
"" type="text/javascript"/"
" type="text/javascript"/
" type="text/javascript"/
.
.
.
<% Html.EnableClientValidation(); %
.
.
.
.
.
.
and validation rule used for that text box is
[StringLength(100, ErrorMessage="This field should be no longer than 100")]
My wish is that validation rules will be applied only when I click on Next button. And when I click on Back button, no validation error message will be displayed and form will be posted to server. Is it possible to do that? could you please tell me how?
My problem now is that when I click Back, validation rules are applied and prevent me from posting back to server.