I try to do the validator for jqxComboBox. I was success for valid while user have select the jqxComboBox. However, the user does not perform select jqxComboBox and that jqxComboBox was required field. It’ was failed to do it.
$(‘#form’).jqxValidator({
rules: [
{ input: ‘#nationality’, message: ‘Nationality is required!’, action: ‘valuechanged,select’, rule: function () {
var item = $(“#nationality”).jqxComboBox(‘getSelectedItem’);
if(item.value > 0 ){
return true
}
return false;
}
}
]
})
$(“#saveButton”).bind(‘click’, function () {
var validationResult = function (isValid) {
if (isValid) {
$(“#form”).submit();
}
}
$(‘#form’).jqxValidator(‘validate’, validationResult);
});
Can you please help me to check on my code and give me an advised? Thanks