I have a form that is extend from Zend_Form. I am placing the form into a ViewScript decorator like this:
$this->setDecorators(array(array('ViewScript', array('viewScript' => 'game/forms/game-management.phtml'))));
I'd like to pass in a variable to this ViewScript but am not sure how this could be done.
Since the partial renders out...
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->...
Hi,
I'm trying to change the html outputted by Zend_Form using decorators.
I want the outputted HTML to look like this:
<form>
<fieldset>
<legend>Your Details</legend>
<dl>
<dt>label etc</dt>
<dd>input etc</dd>
<dt>label etc</dt>
<dd>input etc</dd>
</dl>
</fieldset>
<fieldset>
<legend>Addre...
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,...
I've got a few random issues with decorator related stuff with Zend Form.
Firstly,
// THIS WORKS AND REMOVES THE DECORATORS
$hidden = new Zend_Form_Element_Hidden('hiddenfield');
$hidden->setRequired(TRUE)
->removeDecorator('label')
->removeDecorator('HtmlTag')
->addErrorMessage('Please upl...
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...
Can I use my normal (html) form in Zend Framework ? How can I do that & How can I call action in IndexController file?
...
Having (more) issues with zend form decorators. I've got this so far:
Reset overall form decorator:
$this->clearDecorators();
$this->setDecorators(array('FormElements', 'Form'));
I'm adding all my elements to a display group that i want to be inside a fieldset, within a DL
$group->setDecorators(array(
'FormEle...
How do I do that with Zend_Form?
<ul>
<?php foreach ($this->roles as $module => $resources): ?>
<li>
<?php echo $module; ?>
<ul>
<?php foreach ($resources as $resource => $privileges): ?>
<li>
<?php echo $resource; ?>
<ul>
<?php foreach ($pri...
Hello,i want to add a preview component to my zend form. This preview component basically allows the user to construct a drop down and see how it looks (yes unfortunately that is a requirement).
so im constructing this dropdown - and when the user clicks on 'add drop down' (a button present in that form) , the drop down has to be preview...
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 need to output the following form layout:
<tr><td>Label</td><td>Element</td></tr>
<tr><td></td><td>ElementErrors</td></tr>
This is needed for the elements and labels to be centered vertically and errors should be with the same indentation as elements.
Can I achieve this with the usage of decorators or maybe I need to change my mark...
I have two Zend_Forms (form1 and form2). I would like to combine them so I have a third form (form3) consisting of all the elements from both forms.
What is the correct way to do this with the Zend Framework?
...
Hello,
How can I display more than 1 display group WITHIN a div?
I simply need to show a visual separation - but within the same div.
Is there a way to show more than 1 display group within a div?
for example: to achieve the following in zend forms:
<div style="width: 100%;">
<div style="width: 50%; float: left; paddi...
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...
$button = new Zend_Form_Element_Submit('melnraksts');
$button->setAttrib('id','melnraksts');
$button->setValue(Lang::$form[17]);
$button->setDecorators(array('Composite'));
$button->removeDecorator('Errors');
$form->addElement($button);
$submit = new Zend_Form_Element_Submit('submit');
$submit->setA...
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...
Hi all,
I have a form same the following code:
public function init(){
$id=$this->createElement('hidden','cf_id');
$id->setDecorators($this->elementDecorators);
$id->setOrder(1);
$this->addElement($id);
$firstName=$this->createElement('text','firstName');
$firstName->setDecorators($this->elementDecorators);
$firstName-...
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?
...
$form = new Zend_Form();
$mockDate = new Zend_Form_Element_Text('mock');
$mockDate->addValidator(???????);
$form->addElements(array($mockDate));
$result = $form->isValid();
if ($result) echo "YES!!!";
else echo "NO!!!";
Assumption that the element is in a date format. How do I determine that the date given is greater than or equal...