emma-nemma
New Member
I'm using \[code\]Zend_Form\[/code\] for an application form using this code:\[code\]class Form_ApplicationForm extends Zend_Form{ public function init() { $this->setAction('/application/new') ->setMethod('post') ->setAttrib('id','application'); $name = new Zend_Form_Element_Text('name'); $name->setLabel('Your Name') ->setRequired(TRUE) ->addValidator('alpha', FALSE, array('allowWhiteSpace' => true)); $email = new Zend_Form_Element_Text('email'); $email->setLabel('Email Address') ->setRequired(TRUE) ->addValidator('EmailAddress'); $this->addElements(array($name,$email)); }}\[/code\]I'm adding a flash file uploader (swfupload) to this form which needs a HTML snippet to be in place to work, the snippet looks like this:\[code\]<div id="swfupload-control"> <p>Upload upto 5 image files(jpg, png, gif), each having maximum size of 1MB(Use Ctrl/Shift to select multiple files)</p> <input type="button" id="button" /> <p id="queuestatus" ></p> <ol id="log"></ol></div>\[/code\]What is the best way of inserting this so that it sits somewhere within the \[code\]<form>\[/code\] which i'm inserting within my controller like this:\[code\]public function newAction(){ $form = new Form_ApplicationForm(); if($this->_request->isPost()){ $data = http://stackoverflow.com/questions/2056737/$_POST; if($form->isValid($data)){ /// handle data here }else{ $form->populate($data); } } $this->view->form = $form;}\[/code\]Is there a way of adding a placeholder or similar within \[code\]Zend_Form\[/code\], or should this be done using a decorator or something like that?Thanks.