Field validate required AND unique
Field validate required AND unique
I have an email address in my editor instance which I want to be required and unique.
Field::inst( 'tblpatron.EmailAddress' )
->validator( 'Validate::unique', array(
"required" => true,
"message" => "This email address is already in use"
) )
How can I set the message so that if the field is left empty, i get the 'required' message and if it is a duplicate, I get a different 'unique' message ?
Thanks
This discussion has been closed.
Answers
Ok, I think I've sorted it.
I just called the validation function twice
Yup - perfect. Thanks for posting back.
Allan
thanks. its very helpful