Currently when an invalid value is entered, the ValidationTextBox changes
color and displays a "Caution sign" graphic inside of it.  The
invalidMessage does not display until the user clicks inside the textBox. Is
there anyway to cause the invalidMessage to display at the same time the
"Caution sign" graphic displays?

class Forms_NewsletterSubscribeForm extends Zend_Dojo_Form {

    public function __construct($options = null) {

        parent::__construct($options);

        $this->setAttrib('id','newsletterSubscribe');

        $this->addElement('ValidationTextBox', 'n_email', array(
            'required'      => true,
            'validators'     => array('EmailAddress'),
            'filters'         => array('StringToLower'),
            'regExp'        =>
'^[A-Za-z0-9](([_\.\-]?[a-zA-Z0-9]+)*)@([A-Za-z0-9]+)(([\.\-]?[a-zA-Z0-9]+)*)\.([A-Za-z]{2,})$',
            'promptMessage'    => '[email protected]',
            'invalidMessage'=> 'A Valid Email is Required'
        ));

        $this->addElement(
            'SubmitButton',
            'submit',
            array(
                'label'        => 'Submit',
            )
        );

    }

}

Reply via email to