protected function buildElements() { // Quick search field $full_name = new Zend_Form_Element_Text('fullname'); $full_name->setLabel('Your Name:'); $full_name->setAttrib('class', 'contactforminput'); $full_name->setAttrib('hint', 'your name'); $this->addElement($full_name); // create EMAIL input tag // Unique check, require, email address valid check, length less than 100(database length for this field) // do email address validation(default each email element do email address validation) $credit_email = new Zend_Form_Element_Text('email_from'); $credit_email->setLabel('Your Email:'); $credit_email->setAttrib('class', 'contactforminput'); $this->addElement($credit_email); // create Description Textarea tag // filed type in db is Text $description = new Zend_Form_Element_Textarea('question'); $description->setLabel('Your Question:'); $description->setAttrib('class', 'contactforminput'); $description->setAttrib('hint', 'your question'); $this->addElement($description); // Quick search btn $send = new Zend_Form_Element_Image('submit'); $send->setImage('/images/sitetemplate/send_button.png'); $send->setAttribs(array('rows' => 22, 'cols' => 60)); $send->setImageValue(true); $this->addElement($send); $this->setName("contactform"); $this->setAttrib("onSubmit", "return ValidateForm();"); }
/** * build Listing Form * @see library/CrFramework/CrFramework_Form#init() */ public function init() { logfire('dsfsdf', 'sdfsdfdsfs'); $this->setMethod('post'); $this->setName('refineform'); $this->buildQuickSearchElements(); $this->buildCat1Element(); $this->buildCat2Element(); $this->buildCat3Element(); $this->buildCat4Element(); $this->buildCat5Element(); $this->buildExtraElements(); $this->buildLocationElements(); $this->addElement(Common::createHiddenElement('searchtype', '')); $this->addElement(Common::createHiddenElement('locationid', $this->_location->getLocationId())); $this->setAction('/refine/' . str_replace(' ', '', strtolower($this->_business->getBusinessType()))); /* $cat4 = new Zend_Form_Element_Select('cat4'); $cat4->setLabel($this->_cat4Name); $cat3->addMultiOptions($this->_business->getCat3Options($cat1selectArray[0])); $this->addElement($cat3); $cat3 = new Zend_Form_Element_Select('cat5'); $cat3->setLabel($this->_cat3Name); $cat1selectArray = explode('|', $this->_business->getFirstCat2Option()); $cat3->addMultiOptions($this->_business->getCat3Options($cat1selectArray[0])); $this->addElement($cat3); */ // Quick search btn $submit = new Zend_Form_Element_Image('submit'); $submit->setImage('/images/sitetemplate/find-2-80.png'); $submit->setAttribs(array('rows' => 22, 'cols' => 80)); $submit->setAttrib('onclick', 'return setsearch(2);'); $submit->setImageValue(true); $this->addElement($submit); //$this->addAttribs(array('onsubmit'=>'beforeSubmit()')); // use view script to render form $this->setDecorators(array('FormElements', array('ViewScript', array('viewScript' => 'forms/_refineform.phtml', 'class' => 'hotspotform', 'placement' => false)), 'Form')); }