Hello Everyone,
I have created my own little form element for inputting time's. Since I need this on a few places in my application, i decided to create a seperate element for it.
Here is the code so fa:
class EventManager_Form_Element_Time extends Zend_Form_Element
{
public function init()
{
parent::init();
$...
Hi,
I'm trying to create a custom form element which extends Zend_Form_Element_Text with a validator (so I don't have to keep setting up the validator when I use certain elements). Anyway, I'm having trouble passing $maxChars variable to it when I instantiate it in my Main form. I've provided my shortened code below
This is my custom e...
I have the following Zend_Form_Element:
$imginstructions = "Some description";
$img = $this->createElement('select','img');
$img->setAttrib('class', 'image-select');
$imgdecorator = $img->getDecorator('Description');
$imgdecorator->setOption('escape', false);
$img->setLabel('Image:')
->setRequired(true)
...
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...
I'm trying have default values for Zend_Dojo_Form_Elements be set to '' when a user clicks into the element. This works fine for a TextBox and partially for a FilteringSelect
The FilteringSelect clears, but it does it when you click on the drop down arrow too, causing the drop down to not work. I'd like to have it clear only when you ...
Hi,
I have created this file at My/View/Helper/FormElement.php
<?php
abstract class My_View_Helper_FormElement extends Zend_View_Helper_FormElement
{
protected function _getInfo($name, $value = null, $attribs = null,
$options = null, $listsep = null
) {
$info = parent::_getInfo($name, $value, $attribs, $optio...
Hi,
Problem:
When print elements of form in view, form tag don't created
My View:
<?php
/****** print elements and inser label:: have to be done in this way for integrate cushycms ********/
echo $this->form->empty;
?>
<label>Ad Title</label>
<?php
echo $this->form->adtitle;
?>
<label></label>
<?php echo $this->form->adbody; ?>
...
Hi,
How can be form field names translated when they generate by Zend_Form?
if we have:
<label>Phone</label>
in zend label can be translated by:
<label><?php echo $this->translate('Phone'); ?></label>
but when the label created by Zend_Form:
$phone = new Zend_Form_Element('phone');
$phone->setLabel('Phone');
How can be label t...
Hi!, i have a problem with this Zend form element, how can i read the elements status of Multicheckbox?
$type= new Zend_Form_Element_MultiCheckbox('typer');
$type->setLabel('Type');
$type->addMultiOptions(array(
'1' => 'type1',
'2' => 'type2'
));
Thanks for the support!....
How can I create Zend Form Element implements A html tag not INPUT. I need create something like that:
$Link = new Zend_Form_Element_Link(
$field_name,
array( 'label'=>'THIS IS LINK', 'href'="#", 'other_attrs' => array() )
);
Do I should use loadDefaultDecorators function or either?
This Link element is not actually related t...
How can I make image preview and image-loader (to replace existing image) into the form via only one Zend element. Zend Framework have any solution?
Zend_Form_Element_Image can be helpfull for that, or I need write my self Zend Element?
...
I've tried every thing I can think of and I can't figure out how to display only the ViewHelper decorator on a Zend_Form_Element_File.
$UserPhoto = new Zend_Form_Element_File('UserPhoto');
$UserPhoto->setDestination(TMP_DIR);
$UserPhoto->addValidator('Count', false, 1);
$UserPhoto->addValidator('Size', false, 10240000); // 10 mb max
$th...
I have a form that I am trying to add a simple select element to using the following php:
$dateFormat = new Zend_Form_Element_Select('dateFormat');
$dateFormat->setLabel('Date Format:');
$dateFormat->setRequired(true)->addValidator('NotEmpty');
$dateFormat->addMultiOptions(array(
'MM/dd/yyyy' => "US S...
Is there any way to define wich options in Zend_Form_Element_MultiSelect would be selected by default??
...
I have a Zend_Form with Zend_Form_Select element. I populate it from array (code inside the *Application_Form_MyForm extends Zend_Form* class):
$options = array('first option', 'second option', 'third option');
$this->getElement('mySelect')->addMultiOptions($options);
How can I choose which value is gonna be selected automatically, as...
I have a Zend_Form_Element_MultiSelect element. I would like the output to be something like this:
<select id="users" multiple="multiple" name="users[]">
<option value="1" class="role-1">User 1</option>
<option value="2" class="role-1">User 2</option>
<option value="3" class="role-2">User 3</option>
</select>
Is there a way t...
I have a value that needs to be set in the form for processing, but I do not want the user to be able to edit this value. A hidden element will mostly fit my needs, but I'm concerned a clever user could enable the hidden field and change it.
Is there a validator or setting on the Hidden element that would require the submitted form valu...
I would like to be able to add a hidden form field using array notation to my form. I can do this with HTML like this:
<input type="hidden" name="contacts[]" value="123" />
<input type="hidden" name="contacts[]" value="456" />
When the form gets submitted, the $_POST array will contain the hidden element values grouped as an array:
a...
Hello,
how to handle the lengh of a form input in ZEND FRAMEWORK.K
I WOULD LIKE TO HAVE A MAX OF 4 characters in my zend form element !
Thank you in advance
...
Hello !
I want to be able to add to Zend_Form many Zend_Form_Element_Select.
I've got some loop in My_Form_Selects extends Zend_Form with
$element = $this->createElement('Select', 'element[]');
$this->addElement($element);
but it creates only one select element (Zend_Form ignores [] in element's name).
How should I do this ?
...