public function init()
 {
     // Set the form name, method and action
     $this->setAttrib('name', 'createAgentForm');
     $this->setAttrib('method', 'post');
     $this->setAttrib('action', '/error');
     $this->setDecorators(array(array('ViewScript', array('viewScript' => 'partials/_createAgent.phtml'))));
     // Business Name Element
     $this->addElement('text', 'agent_business', array('filters' => array('StringTrim'), 'label' => 'Business Name:', 'required' => true, 'validators' => array(array('NotEmpty', true), array('StringLength', true, array(1, 150)))));
     // First Name Element
     $this->addElement('text', 'agent_fname', array('filters' => array('StringTrim'), 'label' => 'First Name:', 'required' => true, 'validators' => array(array('NotEmpty', true), array('StringLength', true, array(1, 150)))));
     // Last Name Element
     $this->addElement('text', 'agent_lname', array('filters' => array('StringTrim'), 'label' => 'Last Name:', 'required' => true, 'validators' => array(array('NotEmpty', true), array('StringLength', true, array(1, 150)))));
     // Address1 Element
     $this->addElement('text', 'agent_address1', array('filters' => array('StringTrim'), 'label' => 'Address1:', 'required' => true, 'validators' => array(array('NotEmpty', true), array('StringLength', true, array(1, 150)))));
     // Address2 Element
     $this->addElement('text', 'agent_address2', array('filters' => array('StringTrim'), 'label' => 'Address2:', 'required' => false, 'validators' => array(array('NotEmpty', true), array('StringLength', true, array(1, 150)))));
     // City Element
     $this->addElement('text', 'agent_city', array('filters' => array('StringTrim'), 'label' => 'City:', 'required' => true, 'validators' => array(array('NotEmpty', true), array('StringLength', true, array(1, 150)))));
     $states = new FFR_Form_Element_States();
     // State Element
     $this->addElement('select', 'agent_state', array('filters' => array('StringTrim'), 'label' => 'State:', 'required' => true, 'multiOptions' => $states->buildStates(), 'validators' => array(array('NotEmpty', true), array('StringLength', true, array(1, 50)))));
     // Zipcode Element
     $this->addElement('text', 'agent_zip', array('filters' => array('StringTrim'), 'label' => 'Zipcode:', 'required' => true, 'validators' => array(new FFR_Form_Validator_ValidZipCode(), array('NotEmpty', true), array('StringLength', true, array(1, 10)))));
     // Work Phone Element
     $this->addElement('text', 'agent_workphone', array('filters' => array('StringTrim'), 'label' => 'Work Phone:', 'required' => true, 'validators' => array(new FFR_Form_Validator_ValidPhone(), array('NotEmpty', true), array('StringLength', true, array(1, 15)))));
     // Cell Phone Element
     $this->addElement('text', 'agent_cellphone', array('filters' => array('StringTrim'), 'label' => 'Cell Phone:', 'required' => false, 'validators' => array(new FFR_Form_Validator_ValidPhone(), array('NotEmpty', true), array('StringLength', true, array(1, 15)))));
     // Fax Element
     $this->addElement('text', 'agent_fax', array('filters' => array('StringTrim'), 'label' => 'Fax:', 'required' => false, 'validators' => array(new FFR_Form_Validator_ValidPhone(), array('NotEmpty', true), array('StringLength', true, array(1, 15)))));
     // Email Element
     $this->addElement('text', 'agent_email', array('filters' => array('StringTrim', 'StringToLower'), 'label' => 'Email:', 'required' => true, 'validators' => array(array('NotEmpty', true), array('StringLength', true, array(1, 150)), array('EmailAddress'))));
     // Username Element
     $this->addElement('text', 'agent_username', array('filters' => array('StringTrim'), 'label' => 'Username:'******'required' => true, 'validators' => array(array('NotEmpty', true), array('StringLength', true, array(6, 20)), array('Db_NoRecordExists', true, array('table' => 'user', 'field' => 'user_username')))));
     $this->getElement('agent_username')->getValidator('Db_NoRecordExists')->setMessages(array('recordFound' => 'That username is already taken.  Please choose another.'));
     // Password Element
     $this->addElement('password', 'agent_password', array('filters' => array('StringTrim'), 'label' => 'Password:'******'required' => true, 'validators' => array(array('NotEmpty', true), array('StringLength', true, array(6)))));
     // Password Verify Element
     $this->addElement('password', 'password_confirm', array('filters' => array('StringTrim'), 'label' => 'Confirm Password:'******'required' => true, 'validators' => array(array('NotEmpty', true), array('StringLength', true, array(6)))));
     // Agent Active Element
     $this->addElement('checkbox', 'agent_active', array('label' => 'Active', 'checked' => '0'));
     $this->addElement('hidden', 'agent_perms', array('required' => true, 'value' => 'a:2:{s:5:"roles";a:1:{i:0;s:5:"Agent";}s:13:"acl_resources";a:0:{}}'));
     /**
      * Buttons
      */
     $this->addElement('button', 'saveCloseButton', array('Label' => 'Save & Close', 'class' => 'ui-state-default float-left ui-corner-all ui-button'));
     $this->getElement('saveCloseButton')->removeDecorator('DtDdWrapper');
     $this->addElement('button', 'saveContinueButton', array('Label' => ' Save ', 'class' => 'ui-state-default float-right ui-corner-all ui-button'));
     $this->getElement('saveContinueButton')->removeDecorator('DtDdWrapper');
 }
 public function init()
 {
     // Set the form name, method and action
     $this->setAttrib('name', 'createClientSpouseForm');
     $this->setAttrib('method', 'post');
     $this->setAttrib('action', '/error');
     $this->setDecorators(array(array('ViewScript', array('viewScript' => 'partials/_createClientSpouse.phtml'))));
     // First Name Element
     $this->addElement('text', 'client_fname', array('filters' => array('StringTrim'), 'label' => 'Spouse First Name:', 'required' => true, 'validators' => array(array('NotEmpty', true, array('messages' => array(Zend_Validate_NotEmpty::IS_EMPTY => 'You are required to enter a First Name'))), array('StringLength', true, array(1, 50)))));
     // Last Name Element
     $this->addElement('text', 'client_lname', array('filters' => array('StringTrim'), 'label' => 'Spouse Last Name:', 'required' => true, 'validators' => array(array('NotEmpty', true, array('messages' => array(Zend_Validate_NotEmpty::IS_EMPTY => 'You are required to enter a Last Name'))), array('StringLength', true, array(1, 50)))));
     // Address1 Element
     $this->addElement('text', 'client_address1', array('filters' => array('StringTrim'), 'label' => 'Spouse Address1:', 'required' => false, 'validators' => array(array('StringLength', true, array(1, 100)))));
     // Address2 Element
     $this->addElement('text', 'client_address2', array('filters' => array('StringTrim'), 'label' => 'Spouse Address2:', 'required' => false, 'validators' => array(array('StringLength', true, array(1, 100)))));
     // City Element
     $this->addElement('text', 'client_city', array('filters' => array('StringTrim'), 'label' => 'Spouse City:', 'required' => false, 'validators' => array(array('StringLength', true, array(1, 100)))));
     $states = new FFR_Form_Element_States();
     // State Element
     $this->addElement('select', 'client_state', array('filters' => array('StringTrim'), 'label' => 'State:', 'required' => true, 'multiOptions' => $states->buildStates(), 'validators' => array(new FFR_Form_Validator_ValidUnitedStates(), array('NotEmpty', true), array('StringLength', true, array(1, 50)))));
     // Zipcode Element
     $this->addElement('text', 'client_zip', array('filters' => array('StringTrim'), 'label' => 'Spouse Zipcode:', 'required' => false, 'validators' => array(new FFR_Form_Validator_ValidZipCode(), array('StringLength', true, array(1, 10)))));
     // Work Phone Element
     $this->addElement('text', 'client_homephone', array('filters' => array('StringTrim'), 'label' => 'Spouse Home Phone:', 'required' => false, 'validators' => array(new FFR_Form_Validator_ValidPhone(), array('StringLength', true, array(1, 15)))));
     // Cell Phone Element
     $this->addElement('text', 'client_cellphone', array('filters' => array('StringTrim'), 'label' => 'Spouse Cell Phone:', 'required' => false, 'validators' => array(new FFR_Form_Validator_ValidPhone(), array('StringLength', true, array(1, 15)))));
     // Email Element
     $this->addElement('text', 'client_email', array('filters' => array('StringTrim', 'StringToLower'), 'label' => 'Spouse Email:', 'required' => false, 'validators' => array(array('StringLength', true, array(1, 150)), array('EmailAddress'))));
     // Client DOB Element
     $this->addElement('text', 'client_dob', array('filters' => array('StringTrim'), 'label' => 'Date of Birth:', 'required' => true, 'validators' => array(new FFR_Form_Validator_ValidDate(), array('NotEmpty', true, array('messages' => array(Zend_Validate_NotEmpty::IS_EMPTY => 'You are required to a Date of Birth...'))))));
     //Add Alt DOB Element
     $this->addElement('hidden', 'altDOB', array('required' => false));
     //Add Spouse Id Element
     $this->addElement('hidden', 'spouse_id', array('required' => true));
     //Add Agent Id Element
     $this->addElement('hidden', 'agent_id', array('required' => true));
     //Add Spouse Flag Element
     $this->addElement('hidden', 'client_spouse', array('required' => true, 'value' => '1'));
     /**
      * Buttons
      */
     $this->addElement('button', 'saveCloseButton', array('Label' => 'Save & Close', 'class' => 'ui-state-default float-left ui-corner-all ui-button'));
     $this->getElement('saveCloseButton')->removeDecorator('DtDdWrapper');
     $this->addElement('button', 'saveContinueButton', array('Label' => ' Save ', 'class' => 'ui-state-default float-right ui-corner-all ui-button'));
     $this->getElement('saveContinueButton')->removeDecorator('DtDdWrapper');
 }
 public function init()
 {
     // Set the form name, method and action
     $this->setAttrib('name', 'createAgentStateForm');
     $this->setAttrib('method', 'post');
     $this->setAttrib('action', 'error');
     $this->setDecorators(array(array('ViewScript', array('viewScript' => 'partials/_createAgentState.phtml'))));
     $states = new FFR_Form_Element_States();
     // State Element
     $this->addElement('select', 'agent_state_state', array('filters' => array('StringTrim'), 'label' => 'Licensed State:', 'required' => true, 'multiOptions' => $states->buildStates(), 'validators' => array(array('NotEmpty', true), array('StringLength', true, array(1, 50)))));
     //Add AgentId Element
     $this->addElement('hidden', 'agent_id', array('required' => true));
     /**
      * Buttons
      */
     $this->addElement('button', 'addStateButton', array('Label' => 'Add State', 'class' => 'ui-state-default ui-corner-all ui-button'));
     $this->getElement('addStateButton')->removeDecorator('DtDdWrapper');
 }