I have a zend_form with several elements. Instead of just calling the entire form in my view I would like to call individual elements so I can place them in various places on my page. I call the elements like so:
PHP Code:
echo $this->form->getElement('date_required');
//some html in between......
echo $this->form->getElement('submit')
When I do this my submit button does nothing. So I tried adding this to my view file:
PHP Code:
<form action="<?php echo $this->form->getAction(); ?>" method="<?php echo $this->form->getMethod(); ?>" >
<?php echo $this->form->getElement('date_required');
//some html in between......
echo $this->form->getElement('submit'); ?>
</form>
But that doesn't work either. In my controller I have:
PHP Code:
$form = new Form();
$form->submit->setLabel('save changes');
$this->view->form = $form;
if ($this->_request->isPost())
{
$formData = $this->_request->getPost();
if ($form->isValid($formData))
{ //do stuff.....}
}
Can anyone help???