本文整理汇总了PHP中Zend_Form_Element_Textarea类的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Form_Element_Textarea类的具体用法?PHP Zend_Form_Element_Textarea怎么用?PHP Zend_Form_Element_Textarea使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Zend_Form_Element_Textarea类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
public function init()
{
global $mySession;
$db = new Db();
$ConfigData = $db->runQuery("select * from " . ADMINISTRATOR . " where admin_id='1'");
$SiteTitle = $ConfigData[0]['site_title'];
$MetaDescription = $ConfigData[0]['site_description'];
$MetaKeyword = $ConfigData[0]['site_keyword'];
$AdminEmail = $ConfigData[0]['admin_email'];
$PaypalEmail = $ConfigData[0]['paypal_email'];
$welcomemessageC = $ConfigData[0]['welcomemessage'];
$admin_name_value = $ConfigData[0]['admin_fullname'];
$site_title = new Zend_Form_Element_Text('site_title');
$site_title->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Site title is required.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "mws-textinput required")->setValue($SiteTitle);
$admin_name = new Zend_Form_Element_Text('admin_name');
$admin_name->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Admin name is required.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "mws-textinput required")->setValue($admin_name_value);
$site_description = new Zend_Form_Element_Text('site_description');
$site_description->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Site description is required.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "mws-textinput required")->setValue($MetaDescription);
$site_keyword = new Zend_Form_Element_Text('site_keyword');
$site_keyword->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Site keyword is required.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "mws-textinput required")->setValue($MetaKeyword);
$admin_email = new Zend_Form_Element_Text('admin_email');
$admin_email->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Administrator email is required.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "mws-textinput required email")->setValue($AdminEmail);
$paypal_email = new Zend_Form_Element_Text('paypal_email');
$paypal_email->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Paypal email address is required.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "mws-textinput required email")->setValue($PaypalEmail);
/*$currency_symbol= new Zend_Form_Element_Text('currency_symbol');
$currency_symbol->setRequired(true)
->addValidator('NotEmpty',true,array('messages' =>'Currency symbol is required.'))
->addDecorator('Errors', array('class'=>'error'))
->setAttrib("class","required")
->setValue($CurrencySymbol);*/
$welcomemessage = new Zend_Form_Element_Textarea('welcomemessage');
$welcomemessage->setAttrib("id", "elrte")->setAttrib("cols", "auto")->setAttrib("rows", "auto")->setValue($welcomemessageC);
$this->addElements(array($site_title, $admin_name, $site_description, $site_keyword, $admin_email, $paypal_email, $welcomemessage));
}
示例2: init
public function init()
{
$this->setMethod('post');
$this->setAttrib('id', 'formid');
$this->setAttrib('name', 'holidaygroups');
$id = new Zend_Form_Element_Hidden('id');
$holidayname = new Zend_Form_Element_Text('holidayname');
$holidayname->setAttrib('maxLength', 20);
$holidayname->addFilter(new Zend_Filter_StringTrim());
$holidayname->setRequired(true);
$holidayname->addValidator('NotEmpty', false, array('messages' => 'Please enter holiday.'));
$holidayname->addValidator("regex", true, array('pattern' => '/^[a-zA-Z0-9.\\- ?]+$/', 'messages' => array('regexNotMatch' => 'Please enter valid holiday.')));
$groupid = new Zend_Form_Element_Multiselect('groupid');
$groupid->setAttrib('class', 'selectoption');
$groupid->setRegisterInArrayValidator(false);
$groupid->setRequired(true);
$groupid->addValidator('NotEmpty', false, array('messages' => 'Please select holiday group.'));
$holiday_date = new ZendX_JQuery_Form_Element_DatePicker('holidaydate');
$holiday_date->setAttrib('readonly', 'true');
$holiday_date->setAttrib('onfocus', 'this.blur()');
$holiday_date->setOptions(array('class' => 'brdr_none'));
$holiday_date->setRequired(true);
$holiday_date->addValidator('NotEmpty', false, array('messages' => 'Please select date.'));
$description = new Zend_Form_Element_Textarea('description');
$description->setAttrib('rows', 10);
$description->setAttrib('cols', 50);
$description->setAttrib('maxlength', '200');
$submit = new Zend_Form_Element_Submit('submit');
$submit->setAttrib('id', 'submitbutton');
$submit->setLabel('Save');
$this->addElements(array($id, $holidayname, $groupid, $holiday_date, $description, $submit));
$this->setElementDecorators(array('ViewHelper'));
$this->setElementDecorators(array('UiWidgetElement'), array('holidaydate'));
}
示例3: init
public function init()
{
$this->setMethod('post');
$this->setAttrib('action', BASE_URL . 'payfrequency/edit');
$this->setAttrib('id', 'formid');
$this->setAttrib('name', 'payfrequency');
$id = new Zend_Form_Element_Hidden('id');
$freqtype = new Zend_Form_Element_Text('freqtype');
$freqtype->setAttrib('maxLength', 20);
$freqtype->setLabel("Pay Frequency");
$freqtype->setRequired(true);
$freqtype->addValidator('NotEmpty', false, array('messages' => 'Please enter pay frequency type.'));
$freqtype->addValidator("regex", true, array('pattern' => '/^(?=.*[a-zA-Z])([^ ][a-zA-Z0-9 ]*)$/', 'messages' => array('regexNotMatch' => 'Please enter valid pay frequency type.')));
$freqtype->addValidator(new Zend_Validate_Db_NoRecordExists(array('table' => 'main_payfrequency', 'field' => 'freqtype', 'exclude' => 'id!="' . Zend_Controller_Front::getInstance()->getRequest()->getParam('id') . '" and isactive=1')));
$freqtype->getValidator('Db_NoRecordExists')->setMessage('Pay frequency type already exists.');
$freqshortcode = new Zend_Form_Element_Text('freqcode');
$freqshortcode->setLabel("Short Code");
$freqshortcode->setAttrib('maxLength', 20);
$freqshortcode->addValidator("regex", true, array('pattern' => '/^[a-zA-Z][a-zA-Z0-9]*$/', 'messages' => array('regexNotMatch' => 'Please enter valid pay frequency short code.')));
$freqshortcode->addValidator(new Zend_Validate_Db_NoRecordExists(array('table' => 'main_payfrequency', 'field' => 'freqcode', 'exclude' => 'id!="' . Zend_Controller_Front::getInstance()->getRequest()->getParam('id') . '" and isactive=1')));
$freqshortcode->getValidator('Db_NoRecordExists')->setMessage('Pay frequency short code already exists.');
$description = new Zend_Form_Element_Textarea('freqdescription');
$description->setAttrib('rows', 10);
$description->setAttrib('cols', 50);
$description->setAttrib('maxlength', '200');
$submit = new Zend_Form_Element_Submit('submit');
$submit->setAttrib('id', 'submitbutton');
$submit->setLabel('Save');
$this->addElements(array($id, $freqtype, $freqshortcode, $description, $submit));
$this->setElementDecorators(array('ViewHelper'));
}
示例4: setForm
function setForm()
{
$form = new Zend_Form;
$form->setMethod('post')->setAction('');
//$this->setAttrib('enctype','multipart/form-data');
$file = new Zend_Form_Element_File('video_file');
//$file->setAttrib('class','file');
$file->setLabel('video_file');
$file->setRequired(true);
$video_title = new Zend_Form_Element_Text('video_title');
$video_title ->setRequired(true)->addValidator('NotEmpty',true,array('messages'=>'Tiêu đề không được để trống'));
$video_thumbnail=new Zend_Form_Element_Textarea('video_thumbnail');
$video_thumbnail->removeDecorator('HtmlTag')->removeDecorator('Label');
$video_description = new Zend_Form_Element_Textarea('video_description');
$video_description->setAttrib('rows','7');
$video_description ->setRequired(true)->addValidator('NotEmpty',true,array('messages'=>'Mô tả không được để trống'));
$is_active = new Zend_Form_Element_Radio('is_active');
$is_active->setRequired(true)
->setLabel('is_active')
->setMultiOptions(array("1" => "Có","0" => "Không"));
$file->removeDecorator('HtmlTag')->removeDecorator('Label');
$video_title->removeDecorator('HtmlTag')->removeDecorator('Label');
$video_description->removeDecorator('HtmlTag')->removeDecorator('Label');
$is_active->removeDecorator('HtmlTag')->removeDecorator('Label');
$form->addElements(array($file,$video_title,$video_description,$is_active,$video_thumbnail));
return $form;
}
示例5: init
public function init()
{
// if (!$this->hasTranslator()) {
// $this->setTranslator(Zend_Registry::get('Zend_Translate'));
// }
$userid = new Zend_Form_Element_Hidden('UserID');
$userid->setDecorators(array(array('ViewHelper', array('helper' => 'formHidden'))));
$username = new Zend_Form_Element_Text('Username');
$username->setOptions(array('label' => 'Username', 'required' => TRUE))->setDecorators(array(array('ViewHelper', array('helper' => 'formText')), array('Label', array('class' => 'label'))));
$birthday = new Zend_Form_Element_Text('Birthday');
$birthday->setOptions(array('label' => 'Birthday', 'required' => TRUE))->setDecorators(array(array('ViewHelper', array('helper' => 'formText')), array('Label', array('class' => 'label'))));
$role = new Zend_Form_Element_Select('Role');
$role->setOptions(array('label' => 'User Type', 'MultiOptions' => array(3 => 'User', 2 => 'IT', 1 => 'Admin', 0 => 'SuperAdmin')))->setDecorators(array(array('ViewHelper', array('helper' => 'formSelect')), array('Label', array('class' => 'label'))));
$fullname = new Zend_Form_Element_Text('FullName');
$fullname->setOptions(array('label' => 'FullName'))->setDecorators(array(array('ViewHelper', array('helper' => 'formText')), array('Label', array('class' => 'label'))));
$email = new Zend_Form_Element_Text('Email');
$email->setOptions(array('label' => 'Email', 'required' => TRUE))->setDecorators(array(array('ViewHelper', array('helper' => 'formText')), array('Label', array('class' => 'label'))));
$group = new Zend_Form_Element_Text('Group');
$group->setOptions(array('label' => 'Group'))->setDecorators(array(array('ViewHelper', array('helper' => 'formText')), array('Label', array('class' => 'label'))));
$phone = new Zend_Form_Element_Text('Phone');
$phone->setOptions(array('label' => 'Phone'))->setDecorators(array(array('ViewHelper', array('helper' => 'formText')), array('Label', array('class' => 'label'))));
$address = new Zend_Form_Element_Textarea('Address');
$address->setOptions(array('label' => 'Address', 'style' => "width: 200px; height: 150px"))->setDecorators(array(array('ViewHelper', array('helper' => 'formTextarea')), array('Label', array('class' => 'label'))));
$this->setName('user-form')->setMethod(Zend_Form::METHOD_POST)->setEnctype(Zend_Form::ENCTYPE_URLENCODED)->addElements(array($userid, $username, $role, $fullname, $email, $birthday, $group, $phone, $address))->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'fieldset', 'style' => "padding: 0; border: 0; margin-top: 25px;")), 'Form'));
}
示例6: init
public function init()
{
$this->setName(strtolower(get_class()));
$this->setMethod("post");
$oFormName = new Zend_Form_Element_Hidden("form_name");
$oFormName->setValue(get_class());
$oFormName->setIgnore(FALSE)->removeDecorator("Label");
$this->addElement($oFormName);
$oMessage = new Zend_Form_Element_Textarea("message");
$oMessage->setFilters($this->_aFilters);
$oMessage->setRequired(FALSE);
$oMessage->removeDecorator("label");
$this->addElement($oMessage);
$oIsDing = new Zend_Form_Element_Checkbox("is_ding");
$oIsDing->setLabel("Włącz dźwięk");
$oIsDing->setValue(1);
$this->addElement($oIsDing);
$oSubmit = new Zend_Form_Element_Submit("send_message");
$oSubmit->setLabel("Wyślij wiadomość");
$this->addElement($oSubmit);
$oViewScript = new Zend_Form_Decorator_ViewScript();
$oViewScript->setViewModule("admin");
$oViewScript->setViewScript("_forms/chat.phtml");
$this->clearDecorators();
$this->setDecorators(array(array($oViewScript)));
$oElements = $this->getElements();
foreach ($oElements as $oElement) {
$oElement->setFilters($this->_aFilters);
$oElement->removeDecorator("Errors");
}
}
示例7: __construct
public function __construct($options = null)
{
parent::__construct($options);
$this->setAttrib('accept-charset', 'UTF-8');
$this->setName('safcontrollers');
$id = new Zend_Form_Element_Hidden('id');
$hash = new Zend_Form_Element_Hash('no_csrf_foo', array('salt' => '4s564evzaSD64sf'));
$submit = new Zend_Form_Element_Submit('submit');
$submit->setAttrib('id', 'submitbutton');
$label = new Zend_Form_Element_Text('label');
$label->setLabel('label');
$name = new Zend_Form_Element_Text('name');
$name->setLabel('name');
$image = new Zend_Form_Element_Textarea('image');
$image->setLabel('image');
$description = new Zend_Form_Element_Textarea('description');
$description->setLabel('description');
$safmodulesId = new Zend_Form_Element_Select('safmodules_id');
$options = new Safmodules();
$safmodulesId->addMultiOption('', '----------');
foreach ($options->fetchAlltoFlatArray() as $k => $v) {
$safmodulesId->addMultiOption($k, $v['mlabel']);
}
$safmodulesId->setLabel('safmodules_id');
$this->addElements(array($id, $hash, $label, $name, $image, $description, $safmodulesId));
$this->addElements(array($submit));
}
示例8: init
public function init()
{
$this->setMethod('post');
$this->setAttrib('action', DOMAIN . 'employmentstatus/edit');
$this->setAttrib('id', 'formid');
$this->setAttrib('name', 'employmentstatus');
$id = new Zend_Form_Element_Hidden('id');
$workcode = new Zend_Form_Element_Text('workcode');
$workcode->setAttrib('maxLength', 20);
$workcode->setRequired(true);
$workcode->addValidator('NotEmpty', false, array('messages' => 'Please enter work short code.'));
$workcode->addValidator("regex", true, array('pattern' => '/^(?=.*[a-zA-Z])([^ ][a-zA-Z0-9 ]*)$/', 'messages' => array('regexNotMatch' => 'Please enter valid work short code.')));
$workcodename = new Zend_Form_Element_Select('workcodename');
$workcodename->setAttrib('class', 'selectoption');
$workcodename->setRegisterInArrayValidator(false);
$workcodename->setRequired(true);
$workcodename->addValidator('NotEmpty', false, array('messages' => 'Please select work code.'));
$description = new Zend_Form_Element_Textarea('description');
$description->setAttrib('rows', 10);
$description->setAttrib('cols', 50);
$description->setAttrib('maxlength', '200');
$submit = new Zend_Form_Element_Submit('submit');
$submit->setAttrib('id', 'submitbutton');
$submit->setLabel('Save');
$this->addElements(array($id, $workcode, $workcodename, $description, $submit));
$this->setElementDecorators(array('ViewHelper'));
}
示例9: init
public function init()
{
$this->setMethod('post');
$this->setAttrib('action', BASE_URL . 'veteranstatus/edit');
$this->setAttrib('id', 'formid');
$this->setAttrib('name', 'veteranstatus');
$id = new Zend_Form_Element_Hidden('id');
$veteranstatus = new Zend_Form_Element_Text('veteranstatus');
$veteranstatus->setAttrib('maxLength', 20);
$veteranstatus->setRequired(true);
$veteranstatus->addValidator('NotEmpty', false, array('messages' => 'Please enter veteran status.'));
$veteranstatus->addValidators(array(array('validator' => 'Regex', 'breakChainOnFailure' => true, 'options' => array('pattern' => '/^(?=.*[a-zA-Z])([^ ][a-zA-Z\\s]*)$/', 'messages' => array('regexNotMatch' => 'Please enter valid veteran status.')))));
$veteranstatus->addValidator(new Zend_Validate_Db_NoRecordExists(array('table' => 'main_veteranstatus', 'field' => 'veteranstatus', 'exclude' => 'id!="' . Zend_Controller_Front::getInstance()->getRequest()->getParam('id') . '" and isactive=1')));
$veteranstatus->getValidator('Db_NoRecordExists')->setMessage('Veteran status already exists.');
$description = new Zend_Form_Element_Textarea('description');
$description->setAttrib('rows', 10);
$description->setAttrib('cols', 50);
$description->setAttrib('maxlength', '200');
$submit = new Zend_Form_Element_Submit('submit');
$submit->setAttrib('id', 'submitbutton');
$submit->setLabel('Save');
$url = "'gender/saveupdate/format/json'";
$dialogMsg = "''";
$toggleDivId = "''";
$jsFunction = "'redirecttocontroller(\\'gender\\');'";
$this->addElements(array($id, $veteranstatus, $description, $submit));
$this->setElementDecorators(array('ViewHelper'));
}
示例10: __construct
public function __construct($options = null)
{
parent::__construct($options);
$this->setName('WhatIDoForm');
// image, uploader
$image = new Zend_Form_Element_File('Image');
$image->setLabel('Image:')->setDestination('img/profile')->addValidator('Count', false, 1)->addValidator('Size', false, 10000000)->addValidator('Extension', false, 'jpg,png,gif')->addFilter('Rename', 'WhatIDo.jpg');
// PictureCaption, string
$pictureCaption = new Zend_Form_Element_Textarea('PictureCaption');
$pictureCaption->setLabel('Picture caption:')->setRequired();
// MainText, string
$mainText = new Zend_Form_Element_Textarea('MainText');
$mainText->setLabel('Main text:')->setRequired();
// FooterText, string
$footerText = new Zend_Form_Element_Textarea('FooterText');
$footerText->setLabel('Footer text:')->setRequired();
// LinkText, string
$linkText = new Zend_Form_Element_Text('LinkText');
$linkText->setLabel('Link text:')->setRequired();
// LinkUrl, string
$linkUrl = new Zend_Form_Element_Text('LinkUrl');
$linkUrl->setLabel('Link Url:')->setRequired();
// Submit button
$submit = new Zend_Form_Element_Submit('Submit');
$submit->setLabel('Submit');
$this->addElements(array($image, $pictureCaption, $mainText, $footerText, $linkText, $linkUrl, $submit));
}
示例11: init
public function init()
{
$this->setMethod('post');
$this->setAttrib('action', DOMAIN . 'workeligibilitydoctypes/edit');
$this->setAttrib('id', 'formid');
$this->setAttrib('name', 'workeligibilitydoctypes');
$id = new Zend_Form_Element_Hidden('id');
$documenttype = new Zend_Form_Element_Text('documenttype');
$documenttype->setAttrib('maxLength', 50);
$documenttype->setRequired(true);
$documenttype->addValidator('NotEmpty', false, array('messages' => 'Please enter document type.'));
$documenttype->addValidator("regex", true, array('pattern' => '/^(?=.*[a-zA-Z])([^ ][a-zA-Z0-9\\-\\s]*)$/', 'messages' => array('regexNotMatch' => 'Please enter valid document type.')));
$documenttype->addValidator(new Zend_Validate_Db_NoRecordExists(array('table' => 'main_workeligibilitydoctypes', 'field' => 'documenttype', 'exclude' => 'id!="' . Zend_Controller_Front::getInstance()->getRequest()->getParam('id') . '" and isactive=1')));
$documenttype->getValidator('Db_NoRecordExists')->setMessage('Document type already exists.');
$issuingauthority = new Zend_Form_Element_Select('issuingauthority');
$issuingauthority->setRegisterInArrayValidator(false);
$issuingauthority->setMultiOptions(array('' => 'Select issuing authority', '1' => 'Country', '2' => 'State', '3' => 'City'));
$issuingauthority->setRequired(true);
$issuingauthority->addValidator('NotEmpty', false, array('messages' => 'Please select issuing authority.'));
$description = new Zend_Form_Element_Textarea('description');
$description->setAttrib('rows', 10);
$description->setAttrib('cols', 50);
$description->setAttrib('maxlength', '200');
$submit = new Zend_Form_Element_Submit('submit');
$submit->setAttrib('id', 'submitbutton');
$submit->setLabel('Save');
$this->addElements(array($id, $documenttype, $issuingauthority, $description, $submit));
$this->setElementDecorators(array('ViewHelper'));
}
示例12: __construct
public function __construct($options = null)
{
parent::__construct($options);
parent::__construct();
$account_id = new Zend_Form_Element_Hidden('accountId');
$product_id = new Zend_Form_Element_Hidden('productId');
$newStatus = new Zend_Form_Element_Select('newStatus');
$newStatus->setAttrib('class', 'NormalBtn');
$newStatus->setRequired(true);
$newStatus->addMultiOption('', 'Select...');
$description = new Zend_Form_Element_Textarea('description');
$description->setAttrib('class', 'textfield');
$description->setAttrib('rows', '2');
$description->setAttrib('cols', '20');
$description->setRequired(true);
$newStatus1 = new Zend_Form_Element_Hidden('newStatus1');
$description1 = new Zend_Form_Element_Hidden('description1');
$submit = new Zend_Form_Element_Submit('Submit');
$submit->setLabel('submit');
$submit->setAttrib('class', 'recurring');
$Confirm = new Zend_Form_Element_Submit('Confirm');
$Confirm->setLabel('Confirm');
$Confirm->setAttrib('class', 'recurring');
$this->addElements(array($submit, $description, $newStatus, $account_id, $product_id, $Confirm, $newStatus1, $description1));
}
示例13: init
public function init()
{
$this->setAction(URL_BASE . '/action');
$tr = Zend_Registry::get('tr');
$name = new Zend_Form_Element_Text('name');
$name->setLabel($tr->_('NAME'));
$name->setRequired(true);
$name->addValidator('NotEmpty', true, array('messages' => $tr->_('GENERAL_MISSING_TEXT_VALUE')));
$this->addElement($name);
$enabled = new Zend_Form_Element_Checkbox('enabled');
$enabled->setLabel($tr->_('IS_ACTION_ENABLED'));
$this->addElement($enabled);
$public = new Zend_Form_Element_Checkbox('public');
$public->setLabel($tr->_('IS_ACTION_PUBLIC'));
$this->addElement($public);
$route = new Zend_Form_Element_Text('route');
$route->setLabel($tr->_('CUSTOM_ROUTE'));
$route->setRequired(true);
$route->addValidator('NotEmpty', true, array('messages' => $tr->_('GENERAL_MISSING_TEXT_VALUE')));
$this->addElement($route);
$desc = new Zend_Form_Element_Textarea('description');
$desc->cols = 35;
$desc->rows = 15;
$desc->setLabel($tr->_('DESCRIPTION'));
$desc->setRequired(false);
$this->addElement($desc);
parent::init();
}
示例14: init
public function init()
{
$name = new Zend_Form_Element_Text('name');
$name->setLabel('Name');
$name->setRequired(true);
$this->addElement($name);
$enabled = new Zend_Form_Element_Checkbox('enabled');
$enabled->setLabel('Is the action enabled ?');
$this->addElement($enabled);
$public = new Zend_Form_Element_Checkbox('public');
$public->setLabel('Is the action public ?');
$this->addElement($public);
$use_custom_route = new Zend_Form_Element_Checkbox('use_custom_route');
$use_custom_route->setLabel('Custom Route');
$this->addElement($use_custom_route);
$custom_route = new Zend_Form_Element_Text('route');
//$custom_route->setLabel('Custom Route');
$this->addElement($custom_route);
$desc = new Zend_Form_Element_Textarea('description');
$desc->cols = 40;
$desc->rows = 15;
$desc->setLabel('Description');
$desc->setRequired(false);
$this->addElement($desc);
parent::init();
}
示例15: __construct
public function __construct()
{
$transactionType = new Zend_Form_Element_Select('transactionType');
$transactionType->setAttrib('class', 'NormalBtn');
$transactionType->setRequired(true)->addValidators(array(array('NotEmpty')));
$transactionMode = new Zend_Form_Element_Select('transactionMode');
$transactionMode->setAttrib('class', 'NormalBtn');
$transactionMode->setRequired(true);
// ->addValidators(array(array('NotEmpty')));
$transactionMode->setAttrib('onchange', 'display(this.value);');
$transaction_interest_amount = new Zend_Form_Element_Text('transaction_interest_amount');
$transaction_interest_amount->setAttrib('class', 'NormalBtn');
$transaction_fine_amount = new Zend_Form_Element_Text('transaction_fine_amount');
$transaction_fine_amount->setAttrib('class', 'NormalBtn');
$account_id = new Zend_Form_Element_Text('account_id');
$account_id->setAttrib('class', 'NormalBtn');
$transaction_date = new Zend_Form_Element_Text('transaction_date');
$transaction_date->setAttrib('class', 'NormalBtn');
$transaction_date->setRequired(true)->addValidators(array(array('NotEmpty')));
$transaction_date->setRequired(true)->addValidator(new Zend_Validate_Date('YYYY-MM-DD'), true, array('messages' => array(Zend_Validate_Date::FALSEFORMAT => 'Enter the valid date')));
$transaction_amount = new Zend_Form_Element_Text('transaction_amount');
$transaction_amount->setAttrib('class', 'NormalBtn');
$transaction_remarks = new Zend_Form_Element_Textarea('transaction_remarks', array('rows' => 3, 'cols' => 15));
$transaction_remarks->setAttrib('class', 'NormalBtn');
$transaction_remarks->setRequired(true)->addValidators(array(array('NotEmpty')));
$submit = new Zend_Form_Element_Submit('submit');
$submit->setAttrib('id', 'submit');
$submit->setAttrib('class', 'NormalBtn');
$submit->setLabel('submit');
$this->addElements(array($transactionType, $transactionMode, $transaction_interest_amount, $transaction_fine_amount, $account_id, $transaction_date, $transaction_amount, $transaction_remarks, $submit));
}