protected function addProviderElements() { $this->setDescription(null); // Channel Configuration $this->addElement('text', 'channel_title', array('label' => 'Channel title:', 'filters' => array('StringTrim'))); $this->addElement('text', 'channel_link', array('label' => 'Channel link:', 'filters' => array('StringTrim'))); $this->addElement('text', 'channel_description', array('label' => 'Channel description:', 'filters' => array('StringTrim'))); $this->addElement('text', 'channel_language', array('label' => 'Channel language:', 'filters' => array('StringTrim'), 'value' => 'en-us')); $this->addElement('text', 'channel_copyright', array('label' => 'Channel copyright:', 'filters' => array('StringTrim'))); $this->addElement('text', 'channel_image_title', array('label' => 'Channel image title:', 'filters' => array('StringTrim'))); $this->addElement('text', 'channel_image_url', array('label' => 'Channel image url:', 'filters' => array('StringTrim'))); $this->addElement('text', 'channel_image_link', array('label' => 'Channel image link:', 'filters' => array('StringTrim'))); $this->addDisplayGroup(array('channel_title', 'channel_link', 'channel_description', 'channel_language', 'channel_copyright', 'channel_image_title', 'channel_image_url', 'channel_image_link'), 'general', array('legend' => 'Channel Configuration', 'decorators' => array('FormElements', 'Fieldset'))); // FTP Configuration $this->addElement('text', 'ftp_host', array('label' => 'FTP Host:', 'filters' => array('StringTrim'))); $this->addElement('text', 'ftp_login', array('label' => 'FTP Login:'******'filters' => array('StringTrim'))); $this->addElement('text', 'ftp_password', array('label' => 'FTP Password:'******'filters' => array('StringTrim'))); $this->addDisplayGroup(array('ftp_host', 'ftp_login', 'ftp_password'), 'sftp', array('legend' => 'FTP Configuration', 'decorators' => array('FormElements', 'Fieldset'))); // Feed URL $element = new Zend_Form_Element_Hidden('feed_url'); $element->clearDecorators(); $element->addDecorator('Callback', array('callback' => array($this, 'renderFeedUrl'))); $this->addElement($element); $this->addDisplayGroup(array('feed_url'), 'feed_url_group', array('legend' => '', 'decorators' => array('FormElements', 'Fieldset'))); }
protected function addProviderElements() { $element = new Zend_Form_Element_Hidden('providerElements'); $element->setLabel('DoubleClick Specific Configuration'); $element->setDecorators(array('ViewHelper', array('Label', array('placement' => 'append')), array('HtmlTag', array('tag' => 'b')))); $this->addElements(array($element)); $element = new Zend_Form_Element_Text('cue_points_provider'); $element->setLabel('Cue Points Provider:'); $this->addElement($element); $element = new Zend_Form_Element_Text('items_per_page'); $element->setLabel('Items Per Page:'); $this->addElement($element); $this->setDefault('items_per_page', 100); $this->addDisplayGroup(array('cue_points_provider', 'items_per_page'), 'general_group', array('legend' => 'General', 'decorators' => array('FormElements', 'Fieldset'))); $element = new Zend_Form_Element_Text('channel_title'); $element->setLabel('Channel title:'); $this->addElement($element); $element = new Zend_Form_Element_Text('channel_description'); $element->setLabel('Channel description:'); $this->addElement($element); $element = new Zend_Form_Element_Text('channel_link'); $element->setLabel('Channel link:'); $this->addElement($element); $element = new Zend_Form_Element_Checkbox('ignore_scheduling_in_feed'); $element->setLabel('Ignore Scheduling In Feed, As Default Feed Behavior'); $this->addElement($element); $this->addDisplayGroup(array('channel_title', 'channel_description', 'channel_link', 'ignore_scheduling_in_feed'), 'channel', array('legend' => 'Feed Configuration', 'decorators' => array('FormElements', 'Fieldset'))); $element = new Zend_Form_Element_Hidden('feed_url'); $element->clearDecorators(); $element->addDecorator('Callback', array('callback' => array($this, 'renderFeedUrl'))); $this->addElement($element); $this->addDisplayGroup(array('feed_url'), 'feed_url_group', array('legend' => '', 'decorators' => array('FormElements', 'Fieldset'))); }
/** * Initialization form */ public function init() { // Вызываем родительский метод parent::init(); //---------------- Форма ---------------- // Указываем action формы $urlAction = $this->getUrl('login', 'account'); $urlForgotPassword = $this->getUrl('fetchpassword', 'account'); $this->setAction($urlAction); //Зададим метод передачи данных $this->setMethod('post'); // Задаем атрибут class для формы $this->setAttrib('class', 'myfrm span5'); $this->setAttrib('id', 'login-form'); //$this->setAttrib('class', 'row'); //---------- Имя пользователя -------------- $this->addElement('text', 'username', array('label' => 'Имя входа пользователя', 'required' => true, 'filters' => array('StringTrim'))); //---------- Пароль пользователя -------------- $this->addElement('password', 'password', array('label' => 'Пароль', 'required' => true)); //----------- Скрытый элемент для создания ссылки ----------- //если пользователь забыл свой пароль $forgot_password = new Zend_Form_Element_Hidden('forgot_password', array('label' => $this->Translate('Забыли пароль') . '?')); $forgot_password->clearDecorators(); $forgot_password->addDecorator('AnchorLabel', array('href' => $urlForgotPassword)); $this->addElement($forgot_password); //--------- Добавим кнопку ----------- $this->addElement('submit', 'send', array('ignore' => true, 'label' => 'Вход')); $this->getElement('send')->setAttrib('class', 'btn btn-primary'); //---------------- Группа Авторизационные данные ---------------- // Группируем элементы // Группа полей связанных с авторизационными данными $this->addDisplayGroup(array('username', 'password', 'forgot_password', 'send'), 'authDataGroup', array('legend' => 'Авторизационные данные')); //Добавим скрытый элемент для перенаправления входа пользователя $this->addElement('hidden', 'redirect', array()); }
protected function addProviderElements() { $element = new Zend_Form_Element_Hidden('providerElements'); $element->setLabel('TV.com Provider Configuration'); $element->setDecorators(array('ViewHelper', array('Label', array('placement' => 'append')), array('HtmlTag', array('tag' => 'b')))); $this->addElement($element); $element = new Zend_Form_Element_Text('feed_title'); $element->setLabel('Feed title:'); $element->addValidator(new Zend_Validate_StringLength(0, 128)); $this->addElement($element); $element = new Zend_Form_Element_Text('feed_link'); $element->setLabel('Feed link:'); $element->addValidator(new Zend_Validate_StringLength(0, 255)); $this->addElement($element); $element = new Zend_Form_Element_Text('feed_description'); $element->setLabel('Feed description:'); $element->addValidator(new Zend_Validate_StringLength(0, 255)); $this->addElement($element); $this->addElement('Text', 'feed_language', array('label' => 'Feed language:', 'value' => 'en-us')); $this->addElement('Text', 'feed_copyright', array('label' => 'Feed copyright:')); $this->addElement('Text', 'feed_image_title', array('label' => 'Feed image title:')); $this->addElement('Text', 'feed_image_url', array('label' => 'Feed image url:')); $this->addElement('Text', 'feed_image_link', array('label' => 'Feed image link:')); $this->addElement('Text', 'feed_image_width', array('label' => 'Feed image width:')); $this->addElement('Text', 'feed_image_height', array('label' => 'Feed image height:')); $element = new Zend_Form_Element_Hidden('feed_url'); $element->clearDecorators(); $element->addDecorator('Callback', array('callback' => array($this, 'renderFeedUrl'))); $this->addElement($element); $this->addDisplayGroup(array('feed_title', 'feed_link', 'feed_description', 'feed_language', 'feed_copyright'), 'feed', array('legend' => 'Feed Configuration', 'decorators' => array('FormElements', 'Fieldset'))); $this->addDisplayGroup(array('feed_image_title', 'feed_image_url', 'feed_image_link', 'feed_image_width', 'feed_image_height'), 'feed_image', array('legend' => 'Feed Image Configuration', 'decorators' => array('FormElements', 'Fieldset'))); $this->addDisplayGroup(array('feed_url'), 'feed_url_group', array('legend' => '', 'decorators' => array('FormElements', 'Fieldset'))); }
public function addTargetElement() { require_once 'Zend/Form/Element/Hidden.php'; $element = new Zend_Form_Element_Hidden($this->getTargetParam()); $element->clearDecorators()->addDecorator('viewHelper'); $this->addElement($element); return $this; }
public function addIntendedMethodElement() { require_once 'Zend/Form/Element/Hidden.php'; $element = new Zend_Form_Element_Hidden($this->getIntendedMethodParam()); $element->clearDecorators()->addDecorator('viewHelper')->setValue(''); $this->addElement($element); return $this; }
protected function addProviderElements() { $this->setDescription(null); $element = new Zend_Form_Element_Hidden('feed_url'); $element->clearDecorators(); $element->addDecorator('Callback', array('callback' => array($this, 'renderFeedUrl'))); $this->addElement($element); $this->addDisplayGroup(array('feed_url'), 'feed_url_group', array('legend' => '', 'decorators' => array('FormElements', 'Fieldset'))); }
public function form() { if ($this->_formElement != null) { return $this->_formElement; } $e = new Zend_Form_Element_Hidden($this->key); $e->clearDecorators()->addDecorator('ViewHelper'); return $this->_formElement = $e; }
protected function addProviderElements() { $this->setDescription(null); $element = new Zend_Form_Element_Hidden('feed_url'); $element->clearDecorators(); $element->addDecorator('Callback', array('callback' => array($this, 'renderFeedUrl'))); $this->addElement($element); $this->addDisplayGroup(array('feed_url'), 'feed_url_group', array('legend' => '', 'decorators' => array('FormElements', 'Fieldset'))); $this->addElement('text', 'background_image_wide', array('label' => 'Wide Background Image:', 'filters' => array('StringTrim'))); $this->addElement('text', 'background_image_standard', array('label' => 'Standard Background Image:', 'filters' => array('StringTrim'))); }
protected function addProviderElements() { $this->setDescription(null); $this->addElement('text', 'feed_title', array('label' => 'Feed Title:', 'filters' => array('StringTrim'), 'required' => true)); $this->addElement('text', 'feed_subtitle', array('label' => 'Feed Subtitle:', 'filters' => array('StringTrim'))); $this->addElement('text', 'feed_link', array('label' => 'Feed Link:', 'filters' => array('StringTrim'), 'required' => true)); $this->addElement('text', 'feed_author_name', array('label' => 'Feed Author Name:', 'filters' => array('StringTrim'))); $this->addDisplayGroup(array('feed_title', 'feed_subtitle', 'feed_link', 'feed_author_name'), 'feed_default_values', array('legend' => 'Default Feed Values', 'decorators' => array('FormElements', 'Fieldset'))); $element = new Zend_Form_Element_Hidden('feed_url'); $element->clearDecorators(); $element->addDecorator('Callback', array('callback' => array($this, 'renderFeedUrl'))); $this->addElement($element); $this->addDisplayGroup(array('feed_url'), 'feed_url_group', array('legend' => '', 'decorators' => array('FormElements', 'Fieldset'))); }
protected function addProviderElements() { $element = new Zend_Form_Element_Hidden('providerElements'); $element->setLabel('AVN Provider Configuration'); $element->setDecorators(array('ViewHelper', array('Label', array('placement' => 'append')), array('HtmlTag', array('tag' => 'b')))); $this->addElement($element); $element = new Zend_Form_Element_Text('feed_title'); $element->setLabel('Feed title:'); $element->addValidator(new Zend_Validate_StringLength(0, 128)); $this->addElement($element); $element = new Zend_Form_Element_Hidden('feed_url'); $element->clearDecorators(); $element->addDecorator('Callback', array('callback' => array($this, 'renderFeedUrl'))); $this->addElement($element); $this->addDisplayGroup(array('feed_title', 'feed_link', 'feed_description'), 'feed', array('legend' => 'Feed Configuration', 'decorators' => array('FormElements', 'Fieldset'))); $this->addDisplayGroup(array('feed_url'), 'feed_url_group', array('legend' => '', 'decorators' => array('FormElements', 'Fieldset'))); }
protected function addProviderElements() { $this->setDescription(null); $element = new Zend_Form_Element_Hidden('feed_url'); $element->clearDecorators(); $element->addDecorator('Callback', array('callback' => array($this, 'renderFeedUrl'))); $this->addElement($element); $this->addElement('text', 'channel_title', array('label' => 'Channel title:', 'filters' => array('StringTrim'))); $this->addElement('text', 'channel_link', array('label' => 'Channel link:', 'filters' => array('StringTrim'))); $this->addElement('text', 'channel_description', array('label' => 'Channel description:', 'filters' => array('StringTrim'))); $this->addElement('text', 'channel_language', array('label' => 'Channel language:', 'filters' => array('StringTrim'))); $this->addElement('text', 'channel_copyright', array('label' => 'Channel copyright:', 'filters' => array('StringTrim'))); $this->addElement('text', 'channel_image_title', array('label' => 'Channel image title:', 'filters' => array('StringTrim'))); $this->addElement('text', 'channel_image_url', array('label' => 'Channel image url:', 'filters' => array('StringTrim'))); $this->addElement('text', 'channel_image_link', array('label' => 'Channel image link:', 'filters' => array('StringTrim'))); $this->addElement('text', 'item_media_rating', array('label' => 'Item media rating:', 'filters' => array('StringTrim'))); $this->addDisplayGroup(array('feed_url'), 'feed_url_group', array('legend' => '', 'decorators' => array('FormElements', 'Fieldset'))); }
protected function addProviderElements() { $this->setDescription(''); $this->loadDefaultDecorators(); $this->addDecorator('Description', array('placement' => 'prepend')); $element = new Zend_Form_Element_Hidden('providerElements'); $element->setLabel('At&t Uverse Specific Configuration'); $element->setDecorators(array('ViewHelper', array('Label', array('placement' => 'append')), array('HtmlTag', array('tag' => 'b')))); $this->addElements(array($element)); $this->addElement('text', 'channel_title', array('label' => 'Channel Title:', 'filters' => array('StringTrim'))); $this->addElement('text', 'ftp_host', array('label' => 'FTP Host:', 'filters' => array('StringTrim'))); $this->addElement('text', 'ftp_username', array('label' => 'FTP user name:', 'filters' => array('StringTrim'))); $this->addElement('text', 'ftp_password', array('label' => 'FTP password:'******'filters' => array('StringTrim'))); $this->addElement('text', 'ftp_path', array('label' => 'FTP Path:', 'filters' => array('StringTrim'))); // Feed URL $element = new Zend_Form_Element_Hidden('feed_url'); $element->clearDecorators(); $element->addDecorator('Callback', array('callback' => array($this, 'renderFeedUrl'))); $this->addElement($element); $this->addDisplayGroup(array('feed_url'), 'feed_url_group', array('legend' => '', 'decorators' => array('FormElements', 'Fieldset'))); $this->addMetadataForm(); }
public static function formElement() { $request = Zend_Controller_Front::getInstance()->getRequest(); $config = self::$_registry->get("config"); $hidden = new Zend_Form_Element_Hidden(self::hash_name, array("required" => true, 'filters' => array('MagicCookies'), 'validators' => array(array('validator' => 'MagicCookies', 'options' => array("allowed_referer_hosts" => array($config['webhost'])))))); $hidden->clearDecorators(); //see bug http://framework.zend.com/issues/browse/ZF-8449 $hidden->setAttrib("id", "hash" . self::$_hashQuantity); self::$_hashQuantity += 1; $hidden->setValue(self::getLast(true)); $hidden->setDecorators(array('ViewHelper', 'Errors', array('HtmlTag', array('tag' => 'dd')))); return $hidden; }
protected function addProviderElements() { $element = new Zend_Form_Element_Hidden('providerElements'); $element->setLabel('Comcast MRSS Provider Configuration'); $element->setDecorators(array('ViewHelper', array('Label', array('placement' => 'append')), array('HtmlTag', array('tag' => 'b')))); $this->addElement($element); $element = new Zend_Form_Element_Text('feed_title'); $element->setLabel('Feed title:'); $element->setRequired(true); $element->addValidator(new Zend_Validate_StringLength(0, 38)); $this->addElement($element); $element = new Zend_Form_Element_Text('feed_link'); $element->setLabel('Feed link:'); $element->addValidator(new Zend_Validate_StringLength(0, 80)); $this->addElement($element); $element = new Zend_Form_Element_Text('feed_description'); $element->setLabel('Feed description:'); $element->setRequired(true); $element->addValidator(new Zend_Validate_StringLength(0, 128)); $this->addElement($element); $element = new Zend_Form_Element_Text('feed_last_build_date'); $element->setLabel('Feed last build date:'); $element->setRequired(true); $date = new DateTime('now', new DateTimeZone('UTC')); $element->setValue(str_replace('+0000', 'Z', $date->format(DateTime::ISO8601))); // comcast used Z for UTC timezone in their example (2008-04-11T12:30:00Z) $this->addElement($element); $this->addElement('select', 'c_platform_tv_series_field', array('label' => 'cPlatform TV Series Field:')); $this->addElement('textarea', 'cplatform_xml', array('label' => 'cPlatform TV Series XML', 'rows' => 8)); $this->addMetadataFieldsAsValues('c_platform_tv_series_field'); $this->addDisplayGroup(array('feed_title', 'feed_link', 'feed_description', 'feed_last_build_date', 'cplatform_xml', 'c_platform_tv_series_field'), 'feed', array('legend' => 'Feed Configuration', 'decorators' => array('FormElements', 'Fieldset'))); $element = new Zend_Form_Element_Hidden('feed_url'); $element->clearDecorators(); $element->addDecorator('Callback', array('callback' => array($this, 'renderFeedUrl'))); $this->addElement($element); $this->addDisplayGroup(array('feed_url'), 'feed_url_group', array('legend' => '', 'decorators' => array('FormElements', 'Fieldset'))); }
/** * Add an hidden field to the form without any decorator * * @param string $name Name of the hidden field * @param string $value Value for the hidden field * * @return void */ public function addHidden($name, $value) { $hidden = new Zend_Form_Element_Hidden($name, array('value' => $value)); $hidden->clearDecorators(); $hidden->addDecorator('ViewHelper'); $this->addElement($hidden); }
public function init() { $this->addSubForm(new LandlordsReferencing_Form_Subforms_DataProtection(), 'subform_dataprotection'); $this->setMethod('post'); //Prospective landlord name $this->addElement('select', 'title', array('label' => 'Title *', 'required' => true, 'multiOptions' => array('Mr' => 'Mr', 'Ms' => 'Ms', 'Mrs' => 'Mrs', 'Miss' => 'Miss', 'Dr' => 'Dr', 'Prof' => 'Professor', 'Sir' => 'Sir'), 'validators' => array(array('NotEmpty', true, array('messages' => array('isEmpty' => 'Please select your title', 'notEmptyInvalid' => 'Please select a valid title')))))); //First name entry $this->addElement('text', 'first_name', array('label' => 'First Name *', 'required' => true, 'filters' => array('StringTrim'), 'validators' => array(array('NotEmpty', true, array('messages' => array('isEmpty' => 'Please enter your first name')))), 'attribs' => array('data-ctfilter' => 'yes'))); //Last name entry $this->addElement('text', 'last_name', array('label' => 'Last Name *', 'required' => true, 'filters' => array('StringTrim'), 'validators' => array(array('NotEmpty', true, array('messages' => array('isEmpty' => 'Please enter your last name')))), 'attribs' => array('data-ctfilter' => 'yes'))); //Prospective landlord address details. $hiddenElement = new Zend_Form_Element_Hidden('property_number_name'); $hiddenElement->setRequired(false); $hiddenElement->clearDecorators(); $this->addElement($hiddenElement); // Add postcode element $this->addElement('text', 'property_postcode', array('label' => 'Postcode *', 'required' => true, 'filters' => array('StringTrim'), 'validators' => array(array('NotEmpty', true, array('messages' => array('isEmpty' => 'Please enter a postcode', 'notEmptyInvalid' => 'Please enter a valid postcode'))), array('regex', true, array('pattern' => '/^[0-9a-z]{2,}\\ ?[0-9a-z]{2,}$/i', 'messages' => 'Postcode must be in postcode format'))), 'attribs' => array('data-ctfilter' => 'yes'))); // Add address select element $this->addElement('select', 'property_address', array('label' => 'Please select your address *', 'required' => true, 'multiOptions' => array('' => '--- please select ---'), 'validators' => array(array('NotEmpty', true, array('messages' => array('isEmpty' => 'Please select your property address', 'notEmptyInvalid' => 'Please select your property address')))), 'attribs' => array('data-ctfilter' => 'yes'))); //Phone number entry $this->addElement('text', 'phone_number', array('label' => 'Telephone Number *', 'required' => true, 'validators' => array(array('NotEmpty', true, array('messages' => array('isEmpty' => 'Please enter your phone number'))), array('regex', true, array('pattern' => '/^((\\+44\\s?\\(0\\)\\s?\\d{2,4})|(\\+44\\s?(01|02|03|07|08)\\d{2,3})|(\\+44\\s?(1|2|3|7|8)\\d{2,3})|(\\(\\+44\\)\\s?\\d{3,4})|(\\(\\d{5}\\))|((01|02|03|07|08)\\d{2,3})|(\\d{5}))(\\s|-|.)(((\\d{3,4})(\\s|-)(\\d{3,4}))|((\\d{6,7})))$/', 'messages' => 'Not a valid phone number'))), 'attribs' => array('data-ctfilter' => 'yes'))); //Fax number entry $this->addElement('text', 'fax_number', array('label' => 'Fax Number', 'required' => false, 'validators' => array(array('regex', true, array('pattern' => '/^((\\+44\\s?\\(0\\)\\s?\\d{2,4})|(\\+44\\s?(01|02|03|07|08)\\d{2,3})|(\\+44\\s?(1|2|3|7|8)\\d{2,3})|(\\(\\+44\\)\\s?\\d{3,4})|(\\(\\d{5}\\))|((01|02|03|07|08)\\d{2,3})|(\\d{5}))(\\s|-|.)(((\\d{3,4})(\\s|-)(\\d{3,4}))|((\\d{6,7})))$/', 'messages' => 'Not a valid phone number'))), 'attribs' => array('data-ctfilter' => 'yes'))); //Mobile number entry. We do not currently capture this, so WTF do we ask for it? $this->addElement('text', 'mobile_number', array('label' => 'Mobile Number *', 'required' => true, 'validators' => array(array('NotEmpty', true, array('messages' => array('isEmpty' => 'Please enter your mobile number'))), array('regex', true, array('pattern' => '/^07([\\d]{3})[(\\D\\s)]?[\\d]{3}[(\\D\\s)]?[\\d]{3}$/', 'messages' => 'Not a valid mobile phone number'))), 'attribs' => array('data-ctfilter' => 'yes'))); //The email elements. $emailElement = new Zend_Form_Element_Text('email'); $emailElement->setLabel('Email *'); $emailElement->setRequired(true); $emailElement->addFilter(new Zend_Filter_StringTrim()); $validator = new Zend_Validate_NotEmpty(); $validator->setMessage('Please enter your email address'); $emailElement->addValidator($validator); $validator = new Zend_Validate_EmailAddress(); $validator->setMessages(array(Zend_Validate_EmailAddress::INVALID_HOSTNAME => "Domain name invalid in email address", Zend_Validate_EmailAddress::INVALID_FORMAT => "Invalid email address")); $emailElement->addValidator($validator); $this->addElement($emailElement); //The password element. $passwordElement = new Zend_Form_Element_Password('password'); $passwordElement->setRequired(true); $passwordElement->setLabel('Password *'); $validator = new Zend_Validate_NotEmpty(); $validator->setMessage('Please set a password'); $passwordElement->addValidator($validator); $passwordElement->addValidator(new Zend_Validate_PasswordStrength()); $validator = new Zend_Validate_Identical(); $validator->setToken('confirm_password'); $validator->setMessage('Passwords are not the same', Zend_Validate_Identical::NOT_SAME); $passwordElement->addValidator($validator); $this->addElement($passwordElement); //The confirm password element. $confirmPasswordElement = new Zend_Form_Element_Password('confirm_password'); $confirmPasswordElement->setRequired(true); $confirmPasswordElement->setLabel('Confirm Password *'); $validator = new Zend_Validate_NotEmpty(); $validator->setMessage('Please confirm your password'); $confirmPasswordElement->addValidator($validator); $this->addElement($confirmPasswordElement); // Security question & answer $this->addElement('select', 'security_question', array('label' => 'Security Question *', 'required' => true, 'multiOptions' => array('' => 'Please select'), 'registerInArrayValidator' => false, 'decorators' => array(array('ViewHelper', array('escape' => false)), array('Label', array('escape' => false))), 'validators' => array(array('NotEmpty', true, array('messages' => array('isEmpty' => 'Please select your security question', 'notEmptyInvalid' => 'Please select your security question')))))); $this->addElement('text', 'security_answer', array('label' => 'Answer *', 'required' => true, 'filters' => array('StringTrim'), 'validators' => array(array('NotEmpty', true, array('messages' => array('isEmpty' => 'Please enter your security answer')))))); $this->addElement('text', 'insurance_renewal_date', array('label' => 'Next Landlords Insurance Renewal Date (dd/mm/yyyy)', 'required' => false, 'filters' => array('StringTrim'))); $insuranceRenewalDate = $this->getElement('insurance_renewal_date'); $validator = new Zend_Validate_DateCompare(); $validator->minimum = new Zend_Date(mktime(0, 0, 0, date('m'), date('d'), date('Y'))); // $validator->maximum = new Zend_Date(mktime(0, 0, 0, date('m'), date('d'), date('Y')) + 60 * 60 * 24 * 30); $validator->setMessages(array('msgMinimum' => 'Insurance renewal date cannot be in the past')); $insuranceRenewalDate->addValidator($validator, true); //Grab view and add the date picker JavaScript files into the page head $view = Zend_Controller_Front::getInstance()->getParam('bootstrap')->getResource('view'); $view->headLink()->appendStylesheet('/assets/vendor/bootstrap-datepicker/css/bootstrap-datepicker.min.css', 'screen'); $view->headScript()->appendFile('/assets/vendor/jquery-date/js/date.js', 'text/javascript')->appendFile('/assets/vendor/bootstrap-datepicker/js/bootstrap-datepicker.min.js', 'text/javascript')->appendFile('/assets/landlords-referencing/js/referencingInsuranceRenewalDatePicker.js', 'text/javascript'); //The submit button $submitElement = new Zend_Form_Element_Submit('submit'); $submitElement->setIgnore(true); $this->addElement($submitElement); //Apply decorators. This has to be done unusually for t'ings to work. $this->setElementDecorators(array(array('ViewHelper', array('escape' => false)), array('Label', array('escape' => false)))); $submitElement->removeDecorator('label'); $this->property_number_name->removeDecorator('HtmlTag'); //Grab view and add the address lookup JavaScript into the page head $view = Zend_Controller_Front::getInstance()->getParam('bootstrap')->getResource('view'); $view->headScript()->appendFile('/assets/common/js/addressLookup.js', 'text/javascript'); }