I'm trying to create a form using Zend_Form (Zend_Framework component). The users should be able to add arbitrary number of fields. Just as you can upload files with gmail GUI.
Example:
[_____] [+]
After clicking on the [+] button:
[_____]
[_____] [+]
To get things complicated, I'd like to add field pairs, so it would look like thi...
So, what I would like to do is take one form element and add it to another one:
<!-- original -->
<dl class="zend_form">
<dt>label</dt>
<dd><input id="1"></dd>
<dt>label</dt>
<dd><input id="2"></dd>
</dl>
<!-- desired outcome -->
<dl class="zend_form">
<dt>label</dt>
<dd>
<input id="1">
<input i...
By default Zend Form Text elements don't have a width specified. Textarea elements have a default of rows="24" and cols="80". But when I set a different value...
$body = new Zend_Form_Element_Textarea('body');
$body->setLabel('Body:')
->setRequired(true)
->setAttrib('COLS', '40')
->setAttrib('ROWS', '4');
$this->addElement($...
I would like to add an attribute to some form elements in the action controller, I can do it like this:
$form->element_name->setAttrib('description', '<a href="/controller/action">Anchor</a>');
However in the above example the second argument gets escaped. I would like to have it unescaped. How can I do that?
...
When a visitor enters their email address into a form, I want to check that it's unique. So I have a simple email form:
class Form_Register extends Zend_Form
{
public function __construct($options = null)
{
parent::__construct($options);
$this->setName('register');
$email = new Zend_Form_Element_Text('Email');
$email->s...
I am using Zend Framework. For a particular form, there is not enough space to show the errors next to the form elements. Instead, I want to be able to display the errors above the form. I imagine I can accomplish this by passing $form->getErrorMessages() to the view but how do I disable error messages from being shown be each element...
I would like to edit an element description in the action controller. I'm trying to do it like this:
$form->element->setAttrib('description', '');
But it doesn't work. Any ideas?
...
I have a Zend_Form that has 4 or more subforms.
/**
Code Snippet
**/
$bigForm = new Zend_Form();
$littleForm1 = new Form_LittleForm1();
$littleForm1->setMethod('post');
$littleForm2 = new Form_LittleForm2();
$littleForm2->setMethod('post');
$bigForm->addSubForm($littleForm1,'littleForm1',0);
$bigForm->...
I am trying to recreate the following blog's tabbed forms for my website.
http://zendguru.wordpress.com/2009/01/15/zend-framework-and-dojo-creating-tabbed-form/
I currently have the form displaying on my page, however instead of tabs it displays the whole form like normal. I know that the form is displaying the subforms as I have com...
Ok, I think I did my due diligence here. I couldn't find any reference on how to use a parent form element in a subclassed form. May be because it's obvious to everyone but me. It's got me stumped. This is what I tried.
At first, within my form constructor I called
parent::__construct($options = null);
then accessed the parent elemen...
I'm trying to create a contact form. However at the top of the form the user can select using radio buttons whether he's contacting the technical department or the marketing department. Depending on which he selects, the entire form changes.
How would this be implemented within the Zend Framework? I'm already extending Zend_Form to mak...
Hi.
I have a registration form with a few fields. One of them looks like this:
$first_name = new Zend_Form_Element_Text('first_name');
$first_name ->setLabel("First name")
->setRequired(true)
->addFilter(new Zend_Filter_HtmlEntities());
I use the same form for editing user's deta...
I have been looking for hours and I can't find any documentation anywhere as to how you set the default value of an element using Zend_Config_Ini as the initialisation to a Zend_Form.
I've seen the documentation for how you do it in normal PHP code...
$validators = array(
'month' => array(
'digits',
'default' => '1'...
I'm using Zend_Form for an application form using this 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->setLa...
I'm attempting to create a custom form field in Zend_Form to store a snippet of HTML that is required by SWFUpload(for the purposes of a flash file uploader).
I've tried following a few different tutorials but i'm getting pretty confused, so far this is what i have:
/application/forms/elements/SwfUpload.php
...
I'm having a zend form - comprised of a number of zend - sub forms, where the user is creating a new question (its a content management system).
In one of the subforms, the user can click on a button to add more textfields, like this:
[----------]
[----------]
[click to add more]
which should give
[----------]
[----------]
[---------...
I have a form created with Zend_Form and I would like to setup a Route for the submission, so that instead of the user NOT seeing his URL change OR seeing the URL change to a complicated GET string, it will change to reflect the filters.
BAD:
/products
BAD:
/products?color=white&size=large
GOOD:
/products/white/large
GOOD:
/products/...
I'm using Zend_Form as part of a simple signup process. In part 1 of 2 the user is able to upload a number of images. In part 2 - for each one of these images - I ask the user to add further details - an additional 4 text fields grouped together using addDisplayGroup. Within each display group I want to display a thumbnail of the uploade...
I have a zend form comprised of 4 subforms.
1 of these subforms has 4 elements, and one of those elements is a zend_form_element_checkbox.
I have 4 different display groups (1 for each subform) - one is : 'billing address', one is 'credit card info' , 'notifications' and 'misc'
Assuming that 'notifications' is the part that has the chec...
How do I achieve the following with form decorators for form elements:
<dt>
<ul>
<li>The errors</li>
<li>The errors</li>
</ul>
<label>The label</label>
</dt>
<dd>
<input type="text" value="The input field">
</dd>
In other words, in stead of Errors appended after the input field, I want them prepended before the Label. ...