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...
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"> </dt>
<dd id="dont-element">
<input type="hidden"...
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'...
Currently I can add a Zend Form element dynamically to a form after it is first loaded. I do this through a mouse click and some ajax. However, I want to add the exact same element with a different name (basically I am giving each element an id). However, when I add the field it just shows up like a normal field and isn't Dojo'fied. ...
I am using this ViewScript for my standard form elements:
<div class="field" id="field_<?php echo $this->element->getId(); ?>">
<?php if (0 < strlen($this->element->getLabel())) : ?>
<?php echo $this->formLabel($this->element->getName(), $this->element->getLabel());?>
<?php endif; ?>
<span class="value"><?php echo $this->...
I am using ViewScripts to decorate my form elements. With radio elements, the separator can normally be overridden, but the override is being ignored when I use the ViewScript.
When I use the below call and ViewScript, the radio elements are separated by a '<br />' rather than the space I've specified. If leave the default decorators,...
Hello,
I have an image element in my Zend_Form.
$dropDownButton = new Zend_Form_Element_Image('image_button');
$dropDownButton->setOptions(array('image'=>'/images/image1.png',
'style'=>'padding-top:20px',
)
);
$this->addElement($dropDownButt...
Hi,
I want my own form element based on Zend_Form_Element_File.
My Problem: the custom view helper I created is never run. Instead, always the FormFile Viewhelper is run.
When I inherit from Zend_Form_Element_Xhtml, my custom view helper works.
Does not work:
class XY_Model_Form_Imageu extends Zend_Form_Element_File
{
public $helper...
I had started putting my form element view scripts under '/application/views/scripts/form/' and was able to reference them by 'form/scriptname.phtml', but now I need to make a 'form' controller and I realize this was a short-sighted solution. The examples I've seen use something like '/path/to/your/view/scripts/' which doesn't help me w...
Hi,
I'm trying to add a CSS class to a Zend_Form_Element_Select option, but I just can't find a way to do it.
The desired output would be something like this:
<select name="hey" id="hey">
<option value="value1" style="parent">label1</option>
<option value="value2" style="sibling">sublabel1</option>
<option value="value3" s...
Is it possible to disable individual options in a Zend_Form_Element_Radio? That is, I'd like to add disabled="disabled" to certain input tags.
Does the Zend Framework include this functionality? Or is there another way to accomplish this?
...
Is there a way I can get my the following function ported correctly to the the Zend_Form_Element? I have a custom element and i am passing my own options in for the details of what I am working on: below is the PHP and following will be the INI
$html = $this->helper->formBlah(array(
'name'=>'foo',
'value...
hello
i created a form that it decorates as table form
its my code for decorates
$this->setElementDecorators(array(
'ViewHelper',
'Errors'
array(array('data'=>'HtmlTag'),
array('tag'=>'td','class'=>'element')),
array('Label',array('tag'=>'td')),
array(array('row'...
I'm trying to add a plain text node in a zend form - the purpose is to only dispay some static text.
The problem is - im not aware of any such way to do it.
I have used 'description' but that HAS to be attached to a form element.
Is there any way to simply display some text as part of a form? Zend considers everything as a form eleme...
I have two fields in my Zend Form, and i want to apply the validation rule that ensures the user enters either one of the these two fields.
$companyname = new Zend_Form_Element_Text('companyname');
$companyname->setLabel('Company Name');
$companyname->setDecorators($decors);
$this->addElement($companyname);
$company...
Hi, I need to wrap zend form error messages in custom html.
<div class="cerror" id="ID-error">
<div class="ui-widget">
<div class="ui-state-error ui-corner-all" id="IDerror-msg">
%ZEND_FORM_ERROR_MESSAGE%
</div>
</div>
</div>
Now I get errors in format:
<ul>
<li>Error message</li>
</ul>
I nee...
Not really sure how to frame this question, so bear with me. On my form, I have categories with multiple fees. I want the categories to be a header or caption with the fees rendered as radio buttons like
Category1
rb1 feeName-feeAmount rb2 feeName-feeAmount
Category2
rb1 feeName-feeAmount rb2 feeName-feeAmount
I have the radio butto...
hello all
i saw a example for login form same blow code
class Form_Login extends Zend_Form {
//put your code here
public function init($timeout=360){
$this->addElement('hash', 'token', array(
'timeout' => $timeout
));
$this->setName('Login');
$username = $this->createElement ( 'text'...
Hello, I have form, where some fields are looks like rows, so I can add/delete them using JS.
For example:
Field with ID=1 (existing row)
<input id="id[1]" type="text" name="id[1]" value="1" />
<input id="name[1]" type="text" name="name[1]" value="100" />
Field with ID=2 (existing row)
<input id="name[2]" type="text" name="name[2]...
I have a question field with a list of allowed characters : A-Z,0-9,colon (:), question mark (?), comma(,), hyphen(-), apostrophe (').
I have the regex which works fine, in the fashion :
$question->addValidator('regex', true, array(<regular expresstion>))
The default error message is something like ''' does not match against pattern ...