Fixes #2343 Added $trim property to CRequiredValidator

Issue #2343

There is no test case for CRequiredValidator, so I tried to make one.