Please try this 'remote' validator.
$.extend($.fn.validatebox.defaults.rules, {
remote:{
validator: function(value,param){
var target = this;
var opts = $(this).validatebox('options');
var data = {};
data[param[1]] = value;
if (!opts.notValidate){
$.ajax({
url: param[0],
dataType: 'text',
data: data,
type: 'post',
success: function(data){
if (data == 'true'){
opts.result = true;
} else {
opts.result = false;
}
opts.notValidate = true;
$(target).validatebox('validate');
opts.notValidate = false;
}
});
}
return opts.result!=undefined ? opts.result : true;
},
message:'Please fix this field.'
}
});
Usage example:
<input class="easyui-textbox" validType="remote['php/validation.php','q']">
In your 'validation.php' script, you must receive the 'q' parameter value and return 'true' or 'false' to the browser.
<?php
$q = $_REQUEST['q'];
if (...){
echo 'true';
} else {
echo 'false';
}
?>