Setting value of hidden field in frontend form
Hi
What is the best way of setting a value of a hidden field in a frontend form. I got:
$this->frm->addText('activityId')->setAttributes(array('required' => null, 'type' => 'hidden'));
But if i had the attribute 'value'=>'1' it throws an error that the key value can not be overwritten. Any way of getting around this?
Hi bram, would this be a solution? You can use a hidden field instead of textfield. And the value can be set as a parameter of the addHidden
method, just like addText etc... Or did you try that already?
$this->frm->addHidden('activityId', 1)->setAttributes(array('required' => null));