I really have no idea why my custom rule in jquery isnt working. all it is is looking for a substring in a text, making it required if it DOESNT appear, not required if it does. I am using the jquery validate library. I hope its something simple... please help!
jQuery.noConflict();
(function($) {
$(function() {
$("#frmUpdateCC").validate({
errorContainer: "#updateProfileCC",
errorPlacement: function(error, element) {},
rules: {
txtCardNo1: {
required: true,
creditcard: function() {
var str = $('#txtCardNo1').val();
str = (str.indexOf("xxxxxx"));
return (str != 6 );
}
}
cboMonth1: "required",
cboCard1: "required",
}
});
});
})(jQuery);
Ive tried using !== 6, !='6', and other variations thereof