I am using JQuery validation in a wizard made using Spring Webflow. The validation is set to be enabled when the doc is ready, since I want inline validation. It all works fine.
The issue I am facing is the ‘Previous’ button, if I try to click it; it will not go back, since the validation fails. How can I skip validation when a specific button is pressed? Currently, I created an on click function, but then, Spring webflow cannot return to the previous view.
Any suggestions?
- JQuery validation plugin: http://docs.jquery.com/Plugins/validation
- Spring Webflow: http://www.springsource.org/webflow version 2.x.x
Validation:
$(document).ready(function(){
// Validation for all the forms.
$("#user_details").validate({
rules: { ... },
messages: { ... },
});
...
flow of wizard:
<view-state id="userdetails" view="">
...
<transition on="prev" to="homepage" validate="false"/>
<transition on="next" to="nextstate" validate="true"/>
</view-state>
One way to do it, is to callas below the click event of the back button .