I am having an form in a swipe slider, and I am using the following script to check if my form is valid without a submit because I want to input submit it in another slide:
$('#divId').click(function(e) { e.preventDefault(); $('form').valid(); });
That works great but now I would like to trigger the swipe onClick event only if the validation is correct:
<a href="#" onClick="mySwiper.swipeTo(1, 10)">
Is there an easy way to achieve this?
If valid(); = ok THEN onClick="mySwiper.swipeTo(1, 10)
Scripts:
https://github.com/jzaefferer/jquery-validation
http://www.idangero.us/sliders/swiper/
Other Stack:
jQuery Validation on click without submit