zend-form

Zend_Form and decorators : how to insert html tags on a multi options radioform ?

I'm currently trying to use Zend_Form, and it's decorators mechanism, in order to output some well formated HTML, but I don't manage to have the wanted output. Concretely, I have a radio button form element (Zend_Form_Element_Radio), with a multiple option registred in it, like this: $codeHolder = new Zend_Form_Element_Radio('radiobutt...

Zend_Form with xthml scripts (without using decorators)

(I follow this post to got the logic how to use Zend_Form without using decorators.) within the action I create Zend_Form object and assigned the form to the view before rendering it: public function indexAction() { $form = new Zend_Form(); $form->setAction('process') ->setMethod('post'); $username ...

zend_Form:display validation and error messages

I have a common ‘Contact Form’ in my project which is called in most of pages like index, about us etc. this page accept user inputs and sent an email to admin, then return back to the page, from which it is called Code for contact form is class Form_Contactus extends Zend_Form { public function init() { $this->setMethod('post...

Zend Form - Method to extract Label value from Form Class to show in View Script?

I'm in the process of switching my forms to use a View Script as their decorators. The examples I've seen so far do the following in the View Script: <td><label for='textEmail'>Email:</label></td> <td><?php echo $this->element->textEmail; ?></td> I would like to find a way to have the text to be displayed in the label from the Form Ob...

Zend Form and nested fieldsets/containers?

I have a form. I have a single element that needs to be wrapped in a div or fieldset (for formatting). Then I have two groups of elements, including the above, that I want to wrap in a fieldset or div. I've managed to create two groups, but Zend Form seems to balk at letting me create a group containing a group. Should I be able to do th...

odd Zend_Form_Element_File behavior

I have the following element in my form: $attachment = new Zend_Form_Element_File('attachment'); $attachment->setLabel('Attach File (2MB Max)'); $attachment->addValidator('Count', false, 1); $attachment->addValidator('Size', false, 2048000); If I print the entire form in the view, this field works fine. However I have some very custom...

How do I remove form attributes in Zend Framework?

I have a Form element: $Form=new Zend_Form; $Form->setAction($this->view->url(array('controller'=>'auth','action'=>'create'),null,true)) ->setMethod('post') ->setAttrib('id','auth-form') ->removeAttrib('enctype'); As can be seen I use the removeAttrib method to remove the default enctype. But, when I...

zend session exception on zend_session::start with forms

Hi I'm having issues with trying to use Zend_Form_SubForm and sessions. My controller is in essance acting a wizard showing different subforms depending on the stage of the wizard. Using the example I am planning on storing the forms in a session namespace. My controller looks like this. include 'mylib/Form/addTaskWizardForm.php'; ...

Zend_Form: Element should only be required if a checkbox is checked

Hey there, I've got a Form where the user can check a checkbox "create new address" and can then fill out the fields for this new address in the same form. Now I want to validate the fields of this new address ONLY if the checkbox has been checked. Otherwise, they should be ignored. How can I do that using Zend_Form with Zend_Validate...

Populate a zend_form element from within a forwarded action

I'm pretty sure now that this cannot be done but I would appreciate clarification on why, so I can avoid similar situations in the future! I have a form that when submitted dependent on user input either completes or requires further input with a parameter needing to be passed to the new form. The initial submit works fine and the value...

Zend_form rendering problem

Hi, I need a zend_form which will contain mostly checkboxes. I need to group them and also display a title for each group. e.g. Heading 1 Label1 Check1 Label2 Check2 Label3 Check3 Heading 2 Label4 Check4 Label5 Check5 Label6 Check6 First I don't know how to display the title ("headings")! Is there a way that you can add a label ...

how many dojo fliteringselect can I have on a form?

I have a quick question How many dojo filteringselects can I have on a form? I have a form with 2 filteringselects on it, both getting data from different json datastores to populate the values. However only the first filteringselect is being populated, the other grabs no data. I am using Zend Framework and Zend_Dojo_Form to create ...

How to set either Zend_Form_Element_Text required?

Hi, I'm new to Zend Framework, I have a question is that if I have two Zend_Form_Element_Text in a form, and I want make either of them to be filled by the user. For example, phone number and mobile number. People only need enter one of them to continue. How am I going to do this? Thanks ...

Zend Framework isValid problem with "belongsTo" option on elements.

I am building an application with a fairly hefty form that is built using 11 sub-forms (and I will mention that they are all ZendX_jQuery forms). In one of the sub-forms I have a few quirkier elements. I need a list of features about rooms in a house. So I require multiple text input boxes that belong to an array - these inputs are the...

Site wide Zend_Form

How can I add a form to my layout.phtml? I would like to be able to have a search form and a login form that persists through every form on my site. ...

Zend Framework Zend Zend_Form_SubForm Label

Hello Been looking for a while on how to sort this out. Essentially, I just need to set a label for a Zend Framework Sub Form. However I try to do this is just doesn't work. Zend Sub Form doesn't have a Label attribute so you can't seem to set it. However, when the form renders, you can clearly see a DT tag inwhich the label should ...

Zend_Translate Help - Slovak Languege

I need to just translate form error messages in my application. The application is not multilingual, it is al in Slovak (so I already write labels and stuff in Slovak language), just need to translate error messages. I have made this method in my bootstrap file: protected function _initTranslate() { $this->translate = new Zend_Tr...

How to test file's upload function with logic placed in rename filter (Zend_Form_Element_File)?

First my code: class ProfileController extends Zend_Controller_Action { private function getUploadAvatarForm() { $form = new Zend_Form; $form->setAttrib('enctype', 'multipart/form-data'); $form->setAction($this->view->baseUrl('/profile/upload-avatar')) ->setName('uploadAvatarForm') ->setMethod('POST'); ...

Exclude elements while validating a Zend Form

I have a Zend Form with a subform which only is shown when the user selects a specific checkbox. Some of the fields in the subform are required IF the checkbox is selected, otherwise, the fields in that subform should be ignored by IsValid. What would be the way to go here? ...

Duplicated Zend_Form Element ID in a page with various forms

How do I tell the Zend_Form that I want an element (and it's ID-label, etc) to use another ID value instead of the element's name? I have several forms in a page. Some of them have repeated names. So as Zend_Form creates elements' IDs using names I end up with multiple elements with the same ID, which makes my (X)HTML document invalid. ...