Here is how to validate an editable combobox.
Add a new validatebox rule
$.extend($.fn.validatebox.defaults.rules, {
valid: {
validator: function(value, param){
var string = JSON.stringify($(param[0]).combobox('getData'));
if (string.toLocaleUpperCase().indexOf('"' + value.toLocaleUpperCase() + '"') > 0) {
return true;
}
else {
return false;
}
},
message: 'Invalid data.'
}
});
Apply the new rule to your combobox (can be used with required: true)
<input id="cc" class="easyui-combobox" name="dept" validType='valid[cc]' >
Validate onSubmit
$('#ff').form({
url:...,
onSubmit: function(){
return $(this).form('enableValidation').form('validate');
},
success:function(data){
alert(data)
}
});
When you submit the form if the data entered in the combobox does not match the select option data the form returns false and the combobox in highlighted in red.