After validate I need to trigger custom submits on different hidden buttons. Code works fine but it do only default. What I`m doing wrong?
Here is spart off form:
<label for="a1"><input id="a1" type="radio" name="method" value="PayPal" validate="required:true" checked>PayPal</label>
<label for="a2"><input id="a2" type="radio" name="method" value="SEB">SEB</label>
…
<input class="checkout" type="button" value="checkout">
<input class="paypal" type="button" value="paypal">
Nad here is script
…
$(document).ready(function() {
$("#checkout").validate({
success: "valid",
submitHandler: function(form) {
var v = "$('input[name=method]:checked', '#checkout').val()";
switch(v){
case "PayPal": $('.paypal').trigger('click');
default: ^$('.checkout').trigger('click');
break;
}
}
});
});
I need any fresh ideas to make this work.
Try this, you haven’t broke on your case:
Also, you have extra quotes around your
var vdeclaration