[dev] Question to Horde Form Actions

Jan Schneider jan at horde.org
Tue Jul 10 10:11:47 UTC 2012


Zitat von Karim Geiger <geiger at b1-systems.de>:

> Hi Jan,
>
> Am 09.07.12 15:17, schrieb Jan Schneider:
>> You need to attach an action to the training_classroom variable instead,
>> because this is the field that should trigger the action (disabling the
>> second field).
>
> Okay I've tried attaching the action to the other variable.. that's what
> the code looks like:
>
> $o = $this->addVariable(_("Mobile classroom"),
> 'training_needclassroom', 'enum', true, false, _("Do we need to
> prepare a mobile classroom?"), array(array(1 => _('yes'), 0 =>
> _('no')), true));
>
> $params = array('target' => 'training_sub', 'enabled' => true,
> 'values' => array(1)); $o->setAction(new
> Horde_Form_Action_ConditionalEnable($params));
>
> $this->addVariable(_("Sub-Item"), 'training_sub', 'text', false);
>
>> And you might want to use the reload action instead, so that you can
>> completely ignore the other field if necessary.
>
> Could you please send me an example of reload actions?

Nag_Form_Task, Whups_Form_Query_PropertyCriterion,  
Whups_Form_Ticket_Edit, Horde_Config_Form
-- 
Jan Schneider
The Horde Project
http://www.horde.org/



More information about the dev mailing list