I am adding a select element to a Zend_Form instance as follows:
$user = $form->createElement('select','user')->setLabel('User: ')->setRequired(true);
foreach($users as $u)
{
if($selected == $u->id)
{
$user->addMultiOption($u->id,$u->firstname.' '.$u->lastname);
//*** some way of setting a selected opt...
I have a contentPane with a remote form, I'm trying to get the form to submit, and stay within the pane, either displaying the form again on error or reporting success.
I'm sure this is easy but I'm stumped, not the first time and not the last I'm sure.
Store Form :
class Services_Form_Store extends Zend_Dojo_Form {
protected ...
Ultimately, I'd like my Zend Form to render this HTML:
<p>Do you have any documents to upload?</p>
<p>Yes <input type="radio" value="Yes" name="uploadChoice" onClick="showTable()"> No <input type="radio" value="No" name="uploadChoice" onClick="hideTable()" checked></p>
Here's what I have in my Zend_Form:
//create radio bu...
I'm totally confused about how decorators work. This is the html structure that I'm trying to achieve:
<form id="" action="" method="post">
<fieldset><legend>Contact form</legend>
<p>
<label for="name">Name</label>
<input type="text" name="name" id="name" size="30" />
</p>
<p>
<label for="email">Ema...
My program uses Zend Framework, and I wanted to protect users from CSRF using Zend_Form_Element_Hash. But It doesn't seem to work.
For example, my code for Logout Form is
$exithash = new Zend_Form_Element_Hash('hihacker', array('salt' => 'exitsalt'));
$this->addElement($exithash);
In my Auth plugin for Controller I do
$e...
In my form, I'm trying to verify that the user fills in the same value both times (to make sure they didn't make a mistake). I think that's what Zend_Validate_Identical is for, but I'm not quite sure how to use it. Here's what I've got so far:
$this->addElement('password', 'password', array(
'label' => 'Password:',
'required' ...
Hello, I am having an incredibly difficult time to decorate a Zend form the way I need to. This is the HTML structure I am in need of:
<table>
<thead><tr><th>one</th><th>two</th><th>three</th><th>four</th></thead>
<tbody>
<tr>
<td><input type='checkbox' id='something'/></td>
<td><img src='src'/></td>
<td><input type='text' id='some...
I'want to render:
<input type="text" value="" name="foo[]" />
<input type="text" value="" name="bar[]" />
but Zend_Form_Element require a (string) name, so I need to do:
$this->addElement('text', '1', array(
'belongsTo' => 'foo'
));
$this->addElement('text', '2', array(
'belongsTo' => 'bar'
));
but the output is:
<input i...
My application is being built in a subdirectory of my local server, that looks something like this:
http://localhost/application/
The problem is that when I set the form action to "/form/save", the form routes to "localhost/form/save", which doesn't exist.
If I set the form action to "/application/form/save", I get an error, becaus...
Hi,
I am not sure if this is the most sensible way of doing this but I thought I would ask anyway.
I have a 'wizard' that I am developing for users to review data that is stored in the database. Each part of the wizard is a simple Zend_Form allowing the users to review and edit the data. However one element of the wizard needs to be a...
I'm writing a form using Zend_Dojo_Form.
Everything goes fine, unless I dynamically insert elements into the form (using ajax, the user can add more elements by clicking a [+] button).
I managed to insert my new Zend_Dojo_Form_Element_FilteringSelect into the page, but the element isn't dojo-enabled (no auto-completion, or tundra styli...
I'm trying to configure a form for Zend_Form using Zend_Config_Ini, and wish to set the options for a select element in the .ini file.
This works fine for options with single string values, i.e.
user.exampleform.elements.subject.options.multiOptions.example = "Example Label"
However, I can't work out how to use a string for the value...
Hi,
I hope that this is a quick question to answer. I am developing a form using Zend_Form, I have a number of Zend_Dojo_Form_Element_Textboxs to add to this form dynamically.
These are added from rows in the database, e.g.
$count = 0;
//we now loop through the skill types and add them to the form.
foreach($skillResult as $ski...
Hello every body,
i m using zend form & create its elements using the code below.
// To create text box.
$txt = $this->CreateElement('text', 'txtName');
$txt = $this->setLabel('First Name');
$elements[] = $element;
it works fine & it is posted firm form as well. But when i used the same technique to show a browse button, like.
// To ...
Hi,
I have a form that is constructed using ZendX_JQuery_Form, the form contains 2 auto complete inputs and 4 datepickers. The datepickers all worked absolutely fine until I added in the autocomplete fields as well, the autocomplete fields (linking to a backend php action in zend framework) work fine as well but they seem to break the d...
Hello!
I want to use Zend_Form because of its validation and filters etc. But the markup for forms is already done. Even worse, it isn't very standardized, so writing my custom decorators is not a solution.
Is there a simple way to "apply" Zend_Form to existing very custom markup? I think it's a common problem.
...
So I've set up testing in my ZF 1.9.5 application thanks to this tutorial, I am able to test my controllers, now I want to create a test for a form. However, I'm having the problem that PHPUnit can't find my form.
Fatal error: Class 'Default_Form_AccountProfile' not found
I'm extending PHPUnit_Framework_TestCase instead of Zend_Test_...
I want to display a Zend Form with one of the elements shown as disabled. I'm setting the value so the user can see it, but I want to disable it so the user can't edit it. This may also involve some sort of css/javascript to ensure that it looks like, and is not editable by the user. This is my element:
$this->addElement('text', 'us...
I'm thinking about adding some validation/filtering to the phone number field of my Zend Framework application. Not sure if this is something I should do or not.
I thought it might be helpful for users to have such a feature so I could enforce a particular display format. I'm not sure if the formatting of the phone number should be stor...
Hi there,
I'm using the PHP Zend Framework.
How can I get the values from the controller sent by:
$infoForm=array(
// I get these values from a DB
'idCity' => $idCity ,
'idRestaurant'=>$idRestaurant
);
$form->populate($infoForm);
i get the info in the Dojo_Form
$city = new Zend_Dojo_Form_Element_FilteringSel...