Zormoni
unread,Sep 10, 2009, 2:43:57 AM9/10/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Zend Framework Developers
I have a problem relating the Zend_Form.
I´m adding a bunch of checkboxes onto my form, using the following
code:
[code]
$roleElement = new Zend_Form_Element_MultiCheckbox( 'roleid' );
$roleElement->setLabel('Part/Instrument');
$roleDAO = new Role();
$counter = 0;
foreach( $roleDAO->fetchAllRoles() as $role )
{
if ( $counter == 3 )
{
$roleElement->addMultiOption( $role->id, $role->rolegroup . " - " .
$role->role );
//@TODO
//Insert class last here onto tag - <input type="checkbox"
class="last" name="roleid[]" />
$counter = 0;
}
else
{
$roleElement->addMultiOption( $role->id, $role->rolegroup . " - " .
$role->role );
$counter ++;
}
}
[/code]
What I want to do is to access the input tag in the function
addMultiOption, so I can add the class "last" in every fourth pass.
But I have a trouble finding a way to access it. Any ideas?