The regex validator has also a INVALID message which you did not set.
Which type has the value you want to validate ? Try a var_dump of the value.

Greetings
Thomas Weidner, I18N Team Leader, Zend Framework
http://www.thomasweidner.com

----- Original Message ----- From: "Bart McLeod" <[email protected]>
To: "fw-general" <[email protected]>
Sent: Thursday, July 09, 2009 2:17 PM
Subject: [fw-general] Zend_Validate_Regex issue


Hi all,

I searched the mailing list and the issue tracker, but I can't find an issue for this. However, I would like to double check with you all, before creating a new issue. Maybe I am just coding wrong or there already exists an issue that you can point me to.

Here's the problem:
I add a Regex validator to a form.

I set the a custom message on Zend_Validate_Regex::NOT_MATCH.

I do not get the custom message, but instead I get:
"Invalid type given, value should be string, integer or float"

Which makes no sense at all (at least to me).

Anyone?

My version is latest trunk, it also affects existing solutions that worked fine for months.

The code:
           $phoneValidator = new Zend_Validate_Regex($pattern);
$phoneValidator->setMessage("U mag de volgende tekens gebruiken: + - ( ) een spatie en cijfers.", Zend_Validate_Regex::NOT_MATCH );
           $telephone->addValidator($phoneValidator);
           $form->addElement($telephone);

Regards,

Bart McLeod

Reply via email to