zend-form

Zend Form from simple html

My task is to create a Zend Form from the next Html: <form method="post"> <h3><a href="">link1</a></h3> <div> <input type="text" name="name1"> </div> <h3><a href="">link2</a></h3> <div> <input type="text" name="name2"> </div> </form> ...

Zend_Dojo_Form in tabs creates ID conflicts

I have a dojo layout that creates a sidebar on the left with a list of pages and a center area which is a tab container. When a user double clicks a page in the sidebar, it creates a new closable tab in the center with a form to edit that page (the form is loaded via the href attribute on the ContentPanes, it's a standard Zend Framework...

Zend_Form, setAttrib('escape',false) not working, help.

Hi everyone, I am using Zend_Form and I would like one of my elements to not escape. I have the following code, I think it should not escape but it does without fail: In form class: $btc_name = $this->createElement('text','btc_name'); $btc_name->setLabel('Company Name') ->setRequired(true) ->setAttrib('size',4...

Help required regarding Zend_Form

Hi all, I wanted following output from Zend_Form please help <form ...> <div class="labels"><b>Name:</b></div> <input type="text" value="" name="name" class="whitelabelform"><br> <div class="labels"><b>Email:</b></div> <input type="text" value="" name="email" class="whitelabelform"><br> <div class="labels"><b>Security code:</b></div> <...

Zend Framework - Where to place Zend_Forms, Controller? Model? Somewhere else?

Hi Where is it best to put the code for building my Zend_Forms? I used to put this logic inside my Controllers, but moved away from that after I needed to use the same form in different places. It meant I had to duplicate the creation of forms in different controllers. So I moved the form creation code into my Models. Does this seem r...

How would I make a Zend_Form_Element_Hidden tag immutable?

I have a value that needs to be set in the form for processing, but I do not want the user to be able to edit this value. A hidden element will mostly fit my needs, but I'm concerned a clever user could enable the hidden field and change it. Is there a validator or setting on the Hidden element that would require the submitted form valu...

How would I format Zend_Form_Element_Radio so the label follows the input?

The default decorator for the Zend_Form_Element_Radio is <label for="type_id-1"><input type="radio" name="type_id" id="type_id-1" value="1">Pack</label> The label tag wraps the input tag. Instead I would like to to look like <input type="radio" name="type_id" id="type_id-1" value="1"><label for="type_id-1">Pack</label> I thought i...

Using custom isValid() function for specific subform in Zend_Form

Hi, I have a form with several subforms. I've overriden the form's isValid function with my own, but can't find any documentation on how to set an isValid function per individual subform. Can someone post a link or sample code so I can learn how to do this please. Thanks in advanced. ...

Zend Form Radio Default Checked

I have the next radio button group: $enabled = $this->createElement('radio', 'enabled') ->setLabel('Enabled') ->setMultiOptions(array('1'=>'yes', '0'=>'no')) ->setValue($rank_values['enabled']) ->setAttrib('id', 'enabled') ->setAttrib('class', $action . '_en...

zend_form set fields required only if checkbox is checked

I'm using Zend_Form with a registration page. I have a checkbox, that if checked, will show additional billing fields. In my form instance, I only want those extra fields to be setRequired(true) if that checkbox is checked. Is there a way to do this? The problem now is I have to set all the billing fields as setRequired(false), but if th...

Zend Framework: Working with Form elements in array notation

I would like to be able to add a hidden form field using array notation to my form. I can do this with HTML like this: <input type="hidden" name="contacts[]" value="123" /> <input type="hidden" name="contacts[]" value="456" /> When the form gets submitted, the $_POST array will contain the hidden element values grouped as an array: a...

Zend Avoid submit button value in GET parameters in url

Hi, I have a form, created with Zend_Form, with method = GET used for searching records with elements as below: [form] user name [input type="text" name="uname"] [input type="submit" value="Search" name="search"] [/form] After form is submitted all the GET parameters along with submit button value are appearing in the url. http://my...

Zend_Form password confirmation with .ini config - Can it be done?

I set out writing a ZF (v1.10.3) application and chose to use Zend_Config_Ini to generate my Zend_Form objects. This was all well and good until I had to test for identical password inputs. This is the part that's misbehaving right now: elements.password.type = password elements.password2.type = password elements.password2.options.va...

Zend Form File, How to indicate to the user that a file was previously uploaded?

Hello, I have a zend form that lets the user fill out attributes of an object. For example, a music artist. The form has basic information about the artist, things like name, phone number, address, and what not, but it also has a file upload field. If the user uploads a file, its stored with this instance of the object in the database ...

Zend Framework: How to make view from bootstrap.php

For example i have echo $this->escape($this->test); in index.phtml and in controller $this->view->test = 'test message';, but i want to do this from bootstrap, becouse i want to show Form in every page (controller). ...

Zend_Forms Errors Decorator - remove html tags

Error decorator input errors such way: <ul class="error"> <li>Error message</li> </ul> How can i remove this tags and leave only error message text? ...

Auto-completion for Zend Form Elements

When creating form elements with Zend (using Zend Studio for Eclipse), I'd like some auto completion or hints. Here's what I'm thinking. I'm sure these exist, but I don't know how to get them. I type createElement and auto-completes gives me the signature createElement($type, $name). Great, I select it. but when I try to set the $typ...

Adding the id attribute to a Zend_Form_Decorator_Label

I would like to add the id attribute to a label field in a Zend Form Element, but when setting 'id'=>'namelabel' in the decorator properties, it sets for='namelabel' in the label instead of adding the attribute of id='namelabel' $name = new Zend_Form_Element_Text('name'); $name->setLabel('Business Name:'); $name->addDecorator('Label',ar...

Folder structure, where to store forms

I'm using ZendStudio which creates an MVC structure for projects. To create a form, I just create a PHP class and extend Zend_Form, but where is the right location to have this form saved. I've seen someone put it in application/forms with application/models application/views application/controllers Is this a best practice or ...

Zend Framework VS jquery validate Vs Form

Just a quick question if someone has already that kind of setup or if there is some source code on the web. I want to add some javascript validation to some Zend Forms. The straight forward approach would be to write the javascript myself but let's say it's time consuming(and that's not the kind of code your really want to write all da...