A set of forms (using Zend_Form) that I have been working on were causing me some headaches trying to figure out what was wrong with my XML configuration, as I kept getting unexpected HTML output for a particular INPUT element. It was supposed to be getting a default value, but nothing appeared.
It appears that the following 2 pieces of...
Hello How can I make hidden multi checkbox in zend form?
...
I'm trying to get the following html out of Zend_Form
<div class="group wat-cf">
<div class="left">
<label class="label right">Username</label>
</div>
<div class="right">
<input type="text" class="text_field">
</div>
</div>
Using the following code:
$username->setAttrib("class", "text_field")
->setDecorators(...
I'm trying to generate this html heirarchy in my zend_form display group:
<div class="settings">
<div class="dashed-outline"> //want to add this div
<fieldset disabledefaultdecorators="1" id="fieldset-settings">
<legend>Cards</legend>
</fieldset>
</div>
</div>
This is what I have cur...
I want to create a display group generated from foreach() clause output. I can't seem to get the syntax correct.
Here's the business logic:
for each category row
find the associated fees
output the category description as a label
and the fees as radio buttons
then create a display group with the fees as the group elements
and the cat...
I'm trying to set the width of the style for a group of < dt > elements in a Zend_Form.
Is there a way to set a class for a dt element, so the end result would be something like this:
<dt id="name-label" class="xyz" > // trying to add the 'class="xyz"
<label class="required" for="name">Name:</label>
</dt>
<dd id=...
Hi,
I have a quick question about adding Zend_Dojo_Form into Zend_layouts.
I have a Zend_Dojo_Form that I want to display in the layout that is used for a particular controller. I can add the form to the layout without any issue however the dojo elements fail to render, as they would do if I added the form to a standard view.
Is th...
I'm trying to set the inner html of the < span > tag here , so it looks like:
Group
this is what i have so far:
$form->addDisplayGroup(
array(
................
),
'maingroup1',
array(
'legend'=>'',
'disa...
I am using an XML config file to tell Zend_Form what elements I want. I would like to have a <select> element, but I am unsure as to how to add <option> tags using the XML syntax.
Sure I am missing something pretty basic.
Ben
...
I'm using zend frame work zend form and zend db for my project.
The problem I have is, when the user enter some special characters in the text field (i.e "I'm"), it is saved in the database with the "\" character (i.e. "I\'"). I need to know how to fix this so it just saved as whatever the user entered.
...
I am attempting to upload a file using Zend Framework 1.8 and I get some errors. Here is the code snippet:
The form element:
$element = new Zend_Form_Element_File('doc');
$element->setLabel('Upload an image:')
->setDestination('/path/to/my/upload/folder');
$element->addValidator('Count', false, 1);
$element->addValidator('Si...
Hi all. I've spend all the day trying to set the Zend_Form decorators for the following format:
<dt>
<label for="square_meters">The label</label>
</dt>
<dd>
<input type="text" name="square_meters" id="square_meters" />
<div class="description-div">m2</div>
</dd>
I got it. Currently this is working with the following array:
$des...
I started getting the following error today, but don't know why and what caused it.
[31-May-2010 03:52:10] PHP Fatal error: Cannot run code from this file in conjunction with non encoded files in ZendFramework-1.10.5/library/Zend/Validate/Hostname/Com.php on line 547
I'm using zend framework version 1.10.5; although version 1.09 also ...
OK. I understand how to use Zend_Form and it's implementation of the decorator pattern. My question is, is this the best way to be going about creating forms? Shouldn't a documents forms be left to to the front-end rather than generating forms programmatically? Doesn't this kinda violate the whole idea of keeping things separate? I mea...
I have a simple content edit form (Zend_Form) that I populate() with an array generated from the Zend_Db_Table_Row_Abstract->toArray() method. It works quite well.
The goal is to not populate one of the form elements with a value.
I'm currently solving this by removing that specific key => value pair from the populating array. I'm curi...
This is a very specific instance where I'm having difficulty getting Zend Form to produce the correct output and supply the correct validation. I may have to go create a composite element but thought I'd ask here first. Here is the HTML I'm trying to get Zend Form to produce. I'd like this to be able to work where if the validation doesn...
Hi,
I have esthetic's problem.
Zend Form not in place label value, how to move them that they will be exactly above text box, and not from left?
(I didn't put filters and validation to make this code simpler here)
My Code Login.php form:
public function init()
{
$username = new Zend_Form_Element_Text('username');
$username->setLab...
Hello everyone,
I am doing a new project in Zend and it needs a drop down which populates y the data from database (i.e Categories).I need to show those categories Data to be shown in the form of Tree view in the Drop Down menu.I have tried a bit doing it by just fetching the data from the database and then arranging them into the ZEND_F...
I am having trouble getting my filters/validators to work correctly on my form, so I want to create a Unit test to verify that the data I am submitting to my form is being filtered and validated correctly.
I started by auto-generating a PHPUnit test in Zend Studio, which gives me this:
<?php
require_once 'PHPUnit/Framework/TestCase.php...
I'm trying to test my form. It will be constructing other objects, so I need a way to mock them. I tried passing them into the constructor...
class Form_Event extends Zend_Form
{
public function __construct($options = null, $regionMapper = null)
{
$this->_regionMapper = $regionMapper;
parent::__construct($options...