allow element value validation with function

Append trainer.validator with ability to validate element value with custom function instead fixed value.