zend-form

Get post data, Zend Framework

Hi, I want to fetch posted data. put I am using no form. the data is postet by a jquery script with method post and I would like to fetch it. I know how to fetch parameters $id = $this->getRequest ()->getParam ( 'id', null ); and form values: $message = $form->getValue ( 'message' ); however I want to access post data and not para...

Populate a checkbox when using a viewScript decorator in Zend Form

I have a zend_form with a checkbox: $horz = new Zend_Form_Element_Checkbox('horizontal'); $horz->setLabel('Display horizontally?'); $horz->setDecorators(array(array('ViewScript', array('viewScript' => 'partials/forms/checkbox.phtml')))); My custom viewScript checkbox.phtml looks like this: <?php $name = $this->element->getName(); ...

Add many select elements with [] in name

Hello ! I want to be able to add to Zend_Form many Zend_Form_Element_Select. I've got some loop in My_Form_Selects extends Zend_Form with $element = $this->createElement('Select', 'element[]'); $this->addElement($element); but it creates only one select element (Zend_Form ignores [] in element's name). How should I do this ? ...

Customizing the Rendering of a Zend_Form_Element_Radio

I have an object that's an instance of a Zend_Form_Element_Radio. I'd like to customize how these radio buttons are displayed. The manual remarks Radio elements allow you to specify several options, of which you need a single value returned. Zend_Form_Element_Radio extends the base Zend_Form_Element_Multi class, allowing you to spe...

Zend_Form action and method

Zend_Form action and method shows by default <form action="" method="post"> ... My wish is not like that... Just be written <form> .. Is that possible ?? How can I do ??? ...

How to format formRadio() Zend Framework

Hi I'm using formRadio() to display two options with radio buttons. Example <li><?php echo $this->formRadio('johnsmith', '1', array(), array('1' => 'Yes', '0' => 'No'), ' '); ?></li> Getting HTML output <li> <label for="johnsmith-1"> <input type="radio" name="johnsmith" id="johnsmith-1" value="1" checked="checked"> Yes ...

Zend ViewScript Decorator the big picture, overall use.how to?

Hello! It's true I've seen a lot of examples on stackoverflow and many from Google search but apparently nobody showed the big picture of how things falls under one another, even from the manual itself. I've just picked Zend Framework(1.10.8) and when creating forms I've finally found that the ViewScript for now is much easier for me...

Zend Form Decorators Error in Table

I am using the next decorators for my input. I want to make this as table. $this->setDecorators(array('ViewHelper','Errors', array(array('data'=>'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row'=>'HtmlTag'),array('tag'=>'tr')) )); But after form validation Er...

Submit button falling out of fieldset when using displayGroup in Zend Framework 1.10.8

I have tried all the combinations I can think off but this form: class Form_Login Extends Zend_Form{ public function init(){ $this->setMethod('post'); $email = new Zend_Form_Element_Text('email'); $emailValidator = new Zend_Validate_EmailAddress(); $emailValidator->setMessage('Please use a valid em...

Syntax for rendeing a zend form in a non zend project

I'm using zend form in a non-zend project and I'm able to access Zend_Form fine from my custom class Custom_Form. Then in the file where I want to render my form, I create an instance of my form, but then I'm not sure how to render it. $form = new Custom_Form(); //how to render the form here var_dump($form); //var_dump looks busy so cou...

Is it possible to load all Zend_Form_Element_* with one statement?

I'd like to load several form elements like Zend_Form_Element_Text with one statement. Is there a way to do this with a * wild card? ...

Zend random salt generation for element_hash

I'm using the following hash with a salt that says 'unique'. I'm not sure if 'unique' is a literal string or an internal zend keyword for Zend to actually generate a unique salt? If it's just a random string I think it's better to change that, so does zend have a random string generation function that could be used to salt this sort of...

Zend Form Multiple Records

Hi, I'm getting to grips with Zend_Form and can create a form to add/edit a single database record, but now I'm trying to create a form to edit multiple records on a single page. For example, if I had a table of sports teams, and another table of players assigned to them teams I would want to be able to click on a team on my site and ha...

Zend_Form - Trying to make a simple, short form... why am I not getting these decorators?!

All I want to do is make a form, in Zend Framework, that looks like this: <p id="foo"> <form action="#" method="post"> <label>Start:</label> <input id="start" type="text" name="start" /> <label>End:</label> <input id="end" type="text" name="end" /> <input type="submit" name="submit" value="Submit" /> </form> </p> and I simply cann...

Persist Zend Form object after redirect

So the thing is I have a form in page A which is being submitted at page B. After validating the form at page B, it should redirect back to page A and show the form with the possible errors that occurred. What's the best way to achieve this? Is it smart to temporary put the whole form object in the session? Or is there a more elegant s...

Problems getting Zend Form to work

I have tried setting up a zend site with the following directory structure : application -configs -forms -modules -admin -default -controllers -IndexController.php -forms -Testform.php -layouts -modules -views Then in my IndexController.php I have the follow...

Decode htmlEntities back on populate Zend Form

Hi, I decode my zend-form with htmlEntities. This works great, but I would like to decode the input back when I repopulate the form back to the user. Is there a way to reverse the setElementFilter in Zend? Example: User fills in input field with You & me Data placed in the database: You &amp; me I get the data back from the data...

ul li list with unique id in Zend_Form using decorators

hi everyone, I need to make the following html using Zend form and form decorators... <ul> <li id="containeruser1"> <label for="user1"><input type="checkbox" class="textbox" value="1" id="user1" name="users[]">User One</label> </li> <li id="containeruser2"> <label for="user2"><i...

Zend validators and error messages: addValidator and addErrorMessage

If I have a form element that has multiple validators attached to it (3 in this example), how would I use addErrorMessage to create custom error messages when each unique validator fails. Is there a way to add a custom message for each validator? $element = new Zend_Form_Element_Text()... $element->.... ->addValidator(...) ...

creating zf custom commands, like zf create form

When I use the zend CLI to create a form, like this, a form gets generated and gets added to the forms folder. zf create form MyForm I have a custom class that I'd like to create a custom command for it in the same way and would like to look at the zf create form command for guidance. I suspected it to be in Zend_Framework/bin where t...