I would to create custom validate that call method from server
// use simple:reactive-method (server directory)
Meteor.methods({
myValidate: function(opt){
if(opt == 'A'){
return true;
}
return false;
}
})
// schema (both directory)
SimpleSchema.messages({
"nameMsg": "[label] must be A"
});
.......
name: {
type: String,
max: 250,
custom: function () {
var nameExist = ReactiveMethod.call("myValidate", this.value);
if (nameExist) {
return "nameMsg";
}
}
}
}
Please help me.