zend-form

Zend_Form:: When should be form created in view and not in controller?

Hi, Zend_Form:: When should be form created in view and not in controller? option 1 - form created in controller and passed to view (usually used) controller: $form=new MyForm(); $this->view->form=$form; view: echo $this->form; option 2 - form created in view directly (looks better to me because form its subpart of view) view:...

Adding form elements to a form powered by Zend_Form

I have a huge and complex form, and I have build it using Zend_Form. There are multiple places in the form where the user can add elements on click. Currently, if the user submits the form, and the validation fails - the elements added by the user are not retained - as they were not a part of the form. Is there a natural way to add them ...

Rendering only the <form> tag

Hi, Is there any way that i can render ONLY the start <form> tag of a Zend_Form object? print $this->registerForm->renderForm(); renders <form></form>, and i only need <form> Edit: After Asleys possible solution i wrote this for My_Form class public function renderFormOpen() { return str_replace('</form>', '', $this->renderFor...

Position Zend_Form errors above form using Zend_Form_Decorator_FormErrors

Hello, In Zend Framework I'm using the standard FormErrors decorator to output form errors in one place, rather than outputting each error below its corresponding element. The decorator works the way I expect it to, except that I can't figure out how to output the errors at the top of the form instead of at the bottom. Is there a way ...

Zend_Form - loadDefaultDecorators :: How to remove decorators label + HtmlTag with loadDefaultDecorators function?

Hi, How to remove decorators label + HtmlTag with loadDefaultDecorators function? My solution - please tell me if my implementation working well or need modifications class MyForm extend Zend_Form{ function init(){ //create form elements ...................................... } public function loadDefaultDecorator...

Zend_Tool & Zend_Forms inside a module

Hi everyone. Here's my problem. I'm developping an application using ZF 1.10.0, and I have a module called Backend. I need to create a Form for that module. But the damn Zend_Tool won't let me make it inside the modules/Backend/forms folder. Is it necessary to put it there (meaning I'll create it manually), ou should I let Zend_Tool cre...

How can I get the description of a select multioptions tag in ZF?

How can I get the description of a select multioptions tag in ZF? If I do this, then I recieve the value, but a want the description $subjectTitle = $feedbackForm->getValue('subjecttitle'); ...

Zend Form SetAction Using Named Routes

I have a form that I am trying to set the action for. I want to declare the action inside my form file (which extends Zend_Form) instead of in a controller or view, using a route I have created in my bootstrap. Usually when I want to use a route I do something like $this->url(array(), 'route-name'); in the view, or $this->_helper->ur...

Form element added using jQuery is not sent on POST

I have a zend_form where I'm allowing the user to add form elements dynamically. Elements are added dynamically using jQuery : something like... $(function(){ $('#more_answers').click(function(){ var elemNum = $('.dummy-element').size(); $("<dd class='dummy-element' id='dummyanswer_"+elemNum+"-element'><input type='text' valu...

Zend_Form: Database records in HTML table with checkboxes

Hi, I am trying to add a HTML multi-column table to a Zend_Form. The table would be populated by data from the database and each row should be preceded by a checkbox, as shown in the ASCII below: +-----+-------------------------+-----------------------+--------------+ | | Column_1 | Column_2 | Column_3 ...

Multidimensional Array based Elements

Using Zend_Form, how would I create form elements like this <input type="text" name="element[1]" value=""/> <input type="text" name="element[2]" value=""/> ...

Zend_Form: Duplicate decorator IDs on subforms

I'm using Zend_Form from Zend Framework 1.10.6 to render a html form. In this form 'z', there's a subform with a field 'a'. The subform is added to the main form twice, once with the name 'x' and once as 'y'. Below is the html rendered by the Zend_Form-object. <form id="z" enctype="application/x-www-form-urlencoded" method="post" actio...

Creating Zend_Form elements from row html

Hi there, I am having an issue with Zend_Form and your help will be appreciated. in fact I have a class to generate categories as options $categories = My_Util_Category::toHtmlSelect();//for simplicity I removed other lines this code generates <select> <option > root</option> <option> root / children</option> </select> On ...

unable to set Error Message for email validation-Zend-form

This is strange. I'm trying to set the error message for my email validation element in Zend form. Other fields are working correctly-but not email-what's up? code bit: $name = new Zend_Form_Element_Text('name'); $name ->setLabel('Name:') ->setRequired(true) ->addValidator('Alnum') ...

Zend Framework: Fill form with data from mapper

There is an example of getting data from form using mapper in official quickstart. But there is no example in the whole Internet of populating form with data from mapper (for usual edit action, for example). I usually do something like this (without using mapper and dbTable): class News_Model_Form_News extends Zend_Form { private $id ...

How can I make a Zend Decorator to allow a default value?

I want a basic: <input type="text" /> And I would like the default value to clear when the user puts in a value (kinda like this). It would be ideal if the default value returned onBlur. I don't want the default value to be submitted if they leave it and click submit. I'm generating the form using Zend, and imagine my solution can f...

Zend_Form - populate form dynamically problem

I've created a Zend_Form with the following elements which are populated by data from a Zend_DB_Table one-to-many query. The form is being used for CRUD and my question concerns updating records. The form looks like this: class Application_Form_Teacher extends Zend_Form { public function init() { //Set the form method, ac...

Zend_Form: Add elements to radio buttons

Hi, I'm trying to add Zend_Form_Elements following the radio buttons in my form, but so far I have been unable to do so. If anyone could point me in the right direction it would be greatly appreciated. Form needs to be rendered as shown below: (*) [____]% ( ) [____]€ ( ) [___] for [___] ...

Zend Decorators - Remove Id Field for DT Wrapper

Hey, I got two forms and they share some ids as two input fields are called 'title'. Zend generates me a nice output like this: <dl class="zend-form"> <dt id="title-label"> <label for="form1-title" class="required">Description</label> </dt> <dd id="title-element"> <input name="form1[title]" id="form1-title" value="..." t...

Zend Framework: What is the right way of setting default decorators for Zend_Form elements

i currently set my default decorators for my Zend_Form using a class extending from Zend_Form ... class Application_Form_Abstract extends Zend_Form { ... function loadDefaultDecorators() { if ($this->loadDefaultDecoratorsIsDisabled()) { return $this; } // ... for elements $decorator...