I have created a custom validation, which I want to use to compare 2 select boxes, but the additonal method is not firing not sure how to fix it? here is the jsfiddle: http://jsfiddle.net/ughCm/97/ On change of select value it is not firing the 'comaremodelyear' method, even not on .valid().
here is the code
$.validator.addMethod("comparemodalyear", function(value, element, param) {
alert('h');
return true;
}, "From year must be greater!");
$(document).ready(function() {
$('#savebtn').click(function() {
var test = $("#experiment").valid();
});
});
html code:
<form id="experiment" action="/" method="post">
<input type="text" required name="fine" />
<select comparemodalyear name="testingA">
<option value="1">Val1</option>
<option value="2">Val2</option>
</select>
<button id="savebtn" type="button">Save</button>
</form>