I have a form with buttons I do not what to Submit the form, but they are (necessarily) submit buttons. I\'ve given them the class \"cancel\" and on the first click they are can
Ok, using what DA commented; I ended up telling the form to NOT validate on submit ( onSubmit: false, ) and then created a function to hide the actual submit button, and have an image (or could of been a normal button) to submit the form on validation being true:
$(function() {
$('#Petform #btnNext').hide();
$('#Petform #NextWrapper').append('')
$('#Petform #NextWrapper img').live('click', function() {
if( $('form').valid() ) {
$('#btnNext').click();
}
});
});
This way the form wont be sent to server if it isnt valid, and normal form buttons/functionality reverts if JS is disabled.
Thanks for the replies, Guys.