zend-form

Se4t Escaping for Zend_Form element description to false

I'm having some trouble dealing with this. This is inside my Zend_Form: $about = $this->addElement('textarea', 'about', array( 'label' => 'About:', 'description' => 'some <strong>description</strong>', 'required' => false, 'filters' => array('StringTrim'), 'validator...

Zend Form: How to create a 'create account form' that checks for unique username?

I have a form where a user can create an account. The username column is unique in the database. If a user tries to create an account with a duplicate username, it throws an exception. This ends up looking pretty ugly. I'm thinking about doing some sort of check before inserting in the database (possibly with ajax) to see if the desired...

passing non Zend_Form variables to a ViewScript

I'm using Zend_Form with a ViewScript decorator. This form will be for managing two fairly simple types of objects but is a big form so I'd like to have a single form / processing function. So I have this: class GameManagementForm extends Zend_Form{ public function __construct($type='flash'){ parent::__construct(); //and later ...

Zend framework forms and jQuery selectors - how to select by... ID?

So I've got this issue with forms generated by Zend Framework. As we know Zend is using this format for ID of HTML elements, i.e: contactDetails[name],contactDetails[email] etc. First of all, why Zend is using invalid HTML to generate forms? There should be no brackets [] inside ids, according to W3C: ID and NAME tokens must begin ...

Zend Framework: How to concatenate two columns and still use fetchPairs() ?

I have a form with a select element that I need to populate with values from a database. Specifically, the name and id of the current users. The fetchPairs() function works great for this! However, I need to concatenate the value from the first_name column and the last_name column and display this as the option label. Is there a way to d...

Zend_Form - XML

I set up my Zend_Form with XML, now just one line I couldn't transfer to XML. /* Do some stuff like $form = new Zend_Form etc */ $form->removeDecorator('HtmlTag'); How could I add removeDecorator to XML? My try: <forms> <login> <action>form/</action> <method>post</method> <options> <removeDecorator>HtmlTag</remo...

decorating Zend_Form_Element_MultiCheckbox in a unordered list

I need to decorate to Zend_Form_Element_MultiCheckbox into a unordered list, I can get each item surround by , by setting setSeparator to '' and the HtmlTag tag to li I just get find anything to set the around this list, anyone able to point me in the right direction? Thanks for reading (My code is below) $interests = new Zend_Form_E...

Serialize Zend_Form

Could there appear some problems if I serialize a with Zend_Form created form and does this help much in view of the performance? ...

Zend_Form Over ridding default decorators.

Hi, I am having trouble over ridding the default set of decorators with Zend_Form. I am attempting to extend Zend_Form in order to implement a different decorator style. class CRM_Form extends Zend_Form { public function init() { $this->setDisableLoadDefaultDecorators(true); $this->addDecorator('FormElements') ->addDecorator(...

How to handle multi-select boxes in a zend framework form?

Just wondering how it works and how to handle the information. Let's say I have a form like this: $multi = new Zend_Form_Element_Multiselect('users'); $multi->setMultiOptions(array( //'option value' => 'option label' '21' => 'John Doe', '22' => 'Joe Schmoe', '23' => 'Foobar Bazbat' )); $form->addElement($multi); If a ...

Using Zend Validate Float with a specific locale

$text = new Zend_Form_Element_Text(); $ValidateRange = new Zend_Validate_Between(0, 999999.99); $ValidateFloat = new Zend_Validate_Float(); $ValidateFloat->setLocale(new Zend_Locale('de_AT')); $ValidateRange->setMessage('Please enter the amount between [0-9999] '); $textValida...

How to set the default checked value of a Zend_Form Radio Element?

I have a radio element with two options. I want to set one as the default value in case the user forgets to check it. How can I do this? Solution: $this->addElement('radio', 'choose', array( 'required' => true, 'multiOptions' => array( 'yes' => 'heck yes', 'no' => 'please no' ), 'value' => 'yes' //key ...

Is there a way to create different sub/forms using Zend_Form and bring them all together into 1 form?

I'm trying to create 1 base form in Zend which is a part of many other forms. Eg: the following 3 elements could be a sub form or a mini form that is a part of a larger form : -Name -Age -Address I just want to re-use the same form in different places - at times adding elements like 'shipping address' etc I'm getting stuck at the data s...

Zend Framework - DisplayGroup inside DisplayGroup

Is this possible to do with display groups in Zend Framework? other ideas on how to do this? <form> <fieldset> <legend>DisplayGroupOuter</legend> <label for="outer">Outer</label> <input type="text" name="outer" id="outer"/> <fieldset> <legend>DisplayGroupInner</legend> <label for="inner">Inner</label> ...

Zend Framework How to list form elements using partialLoop

Hi everybody I'm new to Zend Framework and not sure if this this posible. I want to use partialloop for creating a table with the form fields. I'm using this code in the view: <!-- code in views/scripts/request/edit.phtml --> <table cellpadding='0' cellspacing='0'> <tr> <th>Cliente</th> <th>Descripcion</th> <...

How do configure Zend_Form to use array notation?

I'm having difficulty configuring Zend_Form. I have a Zend_Form sub-class. The form has some required information and some additional information. I want the additional information to be accessible via an array. The submitted data will look something like this: $formData['required1'] $formData['required2'] $formData['addiotnalData']['aD...

How to set the date format of a ZendX_JQuery_Form_Element_DatePicker?

I am trying to set the date format of the date picker element, but I can't get it to work. How do you set the date format of a ZendX_JQuery_Form_Element_DatePicker element? Solution: Strange...I tried my original code sample again, and it worked. $element = new ZendX_JQuery_Form_Element_DatePicker('date', array( 'jQueryParams' => ...

How to get rid of the Zend_Form dl, dt, dd tags?

I would like to get rid of the definition list format of my Zend_Form. This is the layout that I'm going for: <form> <p> <label for="email" class="required">Your email address:</label> <input type="text" name="email" id="email" value=""> </p> <p> <input type="submit" name="submit" id="submit" value="S...

How to set the message of the NotEmpty validator on a Zend_Form_Element?

I have a form element that I'm setting as required: $this->addElement('text', 'email', array( 'label' => 'Email address:', 'required' => true )); Since I'm setting required to true, it makes sure that it's not empty. The default error message looks like this: "Value is required and can't be empty" I tried setting the...

Zend Form: Checkbox element displays as hidden field?

I would like to add a simple check box to my form: $element = new Zend_Form_Element_Checkbox('dont'); $element->setDescription('Check this box if you don\'t want to do this action.'); $form->addElement($element); However, this is what the html looks like: <dt id="dont-label">&nbsp;</dt> <dd id="dont-element"> <input type="hidden"...