Validating with a-la-carte constraints
We also have the ability to validate a target object with custom a-la-carte constraints by passing the constraints inline as an struct of structs. This way you can store these constraint rules anywhere you like.
1
var myConstraints = {
2
login = { required=true, size=6..10 },
3
password = { required=true, size=6..10 }
4
};
5
prc.results = validateModel( target=user, constraints=myConstraints );
Copied!
This will validate the object using the inline constraints that you built.
Last modified 1yr ago
Copy link