try with $this->Form->{$type}('name', array('attributes'));
--
Lep pozdrav, Tilen Majerle
http://majerle.eu



2011/5/10 dreamingmind <[email protected]>

> And changing to the use of the Form helper's input() method isn't a
> clear fix:
>
> echo $form->hidden('ImageImgFileBatch', array(
>     'value' => 1,
>    'name' => 'data[Image][img_file][batch][]',
>    'id' => null,
>    'class' => 'batch'
> ));
>
> Still produces:
>
> <input type="hidden" value="1" name="data[Image][img_file][batch][]">
>
> Regards,
> Don
>
> On May 9, 9:18 pm, dreamingmind <[email protected]> wrote:
> > Any insight into this strange outcome?
> >
> > $type = 'hidden';
> > echo $form->input('ImageImgFileBatch', array(
> >     'value' => 1,
> >     'name' => 'data[Image][img_file][batch][]',
> >     'id' => null,
> >     'class' => 'batch',
> >     'type' => $type
> > ));
> >
> > produces this html:
> >
> > <input type="hidden" value="1" name="data[Image][img_file][batch][]"
> > class=" ">
> >
> > While, simply changing the value of $type:
> >
> > $type = 'text';
> > echo $form->input('ImageImgFileBatch', array(
> >     'value' => 1,
> >     'name' => 'data[Image][img_file][batch][]',
> >     'id' => null,
> >     'class' => 'batch',
> >     'type' => $type
> > ));
> >
> > Produces this html:
> >
> > <div class="input text">
> >    <label for="ImageImgFileBatch">Image Img File Batch</label>
> >    <input type="text" class="batch" value="1" name="data[Image]
> > [img_file][batch][]">
> > </div>
> >
> > Any insight into this Form helper behavior and how to get the
> > attributes to remain in hidden fields (other than hiding them with
> > javascript)?
> >
> > Regards,
> > Don
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> [email protected] For more options, visit this group
> at http://groups.google.com/group/cake-php
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to