Thursday, October 28, 2010

Re: Form drop down - how to add a NULL value

Thanks, this is exactly what i wanted.

On Oct 28, 2:10 pm, "Mike Karthauser" <mi...@brightstorm.co.uk> wrote:
> On Thu, October 28, 2010 1:05 pm, chris wrote:
> > Hi
>
> > Fairly new to developing in cakePHP and run into a problem that I
> > can't see a simple solution for.
>
> > I have a model that has 2 forigen id's. In some cases, I do not want
> > to save anything in one of these id fields.
>
> > I want to give the user a drop down option which reads something like
> > 'None', and that this in turn will set the id field to NULL when it is
> > inserted into the database.
>
> > How would I go about achieving this using cakePHP and the Form Helper?
>
> in your select
>
> echo $this->Form->input('field_id',array('type'=>'select', 'empty'=>'None'));
>
>
>
> > Thanks
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others
> > with their CakePHP related questions.
>
> > You received this message because you are subscribed to the Google Groups
> > "CakePHP" group.
> > To post to this group, send email to cake-php@googlegroups.com
> > To unsubscribe from this group, send email to
> > cake-php+unsubscribe@googlegroups.com For more options, visit this group
> > athttp://groups.google.com/group/cake-php?hl=en
>
> --
> Mike Karthauser
> Managing Director - Brightstorm Ltd
>
> Email: mi...@brightstorm.co.uk
> Web:http://www.brightstorm.co.uk
> Tel:  07939 252144 (mobile)
> Fax: 0870 1320560
>
> Address: 1 Brewery Court, North Street, Bristol, BS3 1JS

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

No comments: