php - Cakephp hidden input field -


so have field want keep hidden in form.

for purpose have tried following:

<?php echo $this->form->input('group_id', array('hiddenfield' => true, 'value'=> 2)); ?> 

i tried:

<?php echo $this->form->input('group_id', array('options' => array('hiddenfield'=> 'true'), 'value'=>2 )); ?> 

how ever still see input field..

what doing wrong?

you misread documentation, assume. hiddenfield enable/disable specific hidden fields specific form fields.

you either looking for

$this->form->hidden('group_id') 

or

$this->form->input('group_id', ['type' => 'hidden']); 

i use latter.

see http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html

but - said - shouldnt use either 1 of those. , omit fields serve no real purpose view , form. instead should inject fields data array prior saving. see http://www.dereuromark.de/2010/06/23/working-with-forms/


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -