Hello,
I'd appreciate a simple PHP validator example to just make clear what the module expects to see. I am trying to validate against blank field have tried the following guess snippets and none is working:

$value != ''
and
if (!$value) return false;
and
if ($value == '') form_set_error();

Thanks,
KT

Comments

TapocoL’s picture

Status: Active » Fixed

Well, I created a validator like this to check if a field has any value in it:

return !empty($value);

It seemed to work fine. However when you are applying a field that will be validated using that validator, "Allow this field to be empty?" MUST NOT be checked, or else your validator will never fail.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.