Skip to main content

Posts

Showing posts from March, 2012

Adding Regex validations in Zend Framework

Hello Friends,       The code to add a validation in zend framework is: given below is the regex for alphanumeric chater! $alpha = new Zend_Validate_Regex( '/^[a-zA-Z0-9]+[0-9]+[a-zA-Z0-9]*$/i' ); $alpha->setMessage( 'Password must be alphanumeric' ); $userPassword->addValidator($alpha); if the regex is not correct nothing will get displayed!