setName('OfflinePdf'); $email=new Zend_Form_Element_Text('email'); $email->setLabel('E-Mail') ->addFilter('StringTrim') ->addValidator('NotEmpty') ->setRequired(true) ->addValidator('EmailAddress'); $realname=new Zend_Form_Element_Text('realname'); $realname->setLabel('真实姓名')->setRequired(true); $phone=new Zend_Form_Element_Text('phone'); $phone->setLabel('电话')->setRequired(true); $unit=new Zend_Form_Element_Text('unit'); $unit->setLabel('单位')->setRequired(true); $postcode=new Zend_Form_Element_Text('postcode'); $postcode->setLabel('邮编')->setRequired(true); $address=new Zend_Form_Element_Text('address'); $address->setLabel('联系地址')->setRequired(true); $project_id=new Zend_Form_Element_Text('projectid'); $project_id->setLabel('项目编号')->setRequired(true); $project_title=new Zend_Form_Element_Text('projecttitle'); $project_title->setLabel('项目名称')->setRequired(true); $project_type=new Zend_Form_Element_Select('projecttype'); $project_type->setLabel('项目类型')->setRequired(true); $project_type->addMultiOption("国家973计划项目课题", "国家973计划项目课题"); $project_type->addMultiOption("国家863计划课题", "国家863计划课题"); $project_type->addMultiOption("国家级科技支撑课题", "国家级科技支撑课题"); $project_type->addMultiOption("国家级科技重大专项", "国家级科技重大专项"); $project_type->addMultiOption("国家级国家重大工程", "国家级国家重大工程"); $project_type->addMultiOption("国家级国家自然科学基金", "国家级国家自然科学基金"); $project_type->addMultiOption("国际合作项目", "国际合作项目"); $project_type->addMultiOption("省部级项目", "省部级项目"); $project_type->addMultiOption("其他项目工程", "其他项目工程"); $project=new Zend_Form_Element_Textarea('project'); $project->setLabel('用途(请详细描述使用目的)')->setRequired(true)->setAttrib('rows',2); $id = new Zend_Form_Element_Hidden('id'); $save = new Zend_Form_Element_Submit('save'); $save->setAttrib('id', 'savebutton')->setLabel('保存并预览PDF'); $submit = new Zend_Form_Element_Submit('submit'); $submit->setAttrib('id', 'submitbutton')->setLabel('提交申请到数据中心'); /*$submit->setDecorators(array( 'ViewHelper', 'Description', 'Errors', //array(array('elementDiv' => 'HtmlTag'), array('tag' => 'div')), array(array('dl' => 'HtmlTag'), array('tag' => 'dl','class'=>'submit')) )); $this->setDecorators(array( 'FormElements', array('HtmlTag', array('tag' => 'dl', 'class' => 'userform')), array('Description', array('placement' => 'prepend')), 'Form' ));*/ $this->addElements(array($realname,$email,$phone,$unit,$address,$postcode,$project_id,$project_title,$project_type,$project,$id,$save,$submit)); } }