Re: CakePHP 1.3 Form Helper creating drop down and not input field
This works for: echo $form->input But not: echo $this->Form->inputs Any way it will work with the latter? On Jul 17, 6:41 am, spheroid wrote: > The "'type' => 'text'" worked, thanks Jeremy! I wanted all to be > inputs. Perfect. > > On Jul 16, 2:29 pm, Miles J wrote: > > > > > Exactly what Jeremy said. I actually ran into this problem yesterday, > > I resolved it by just putting "type" => "text". > > > Sometimes I love Cakes automagic-ness, sometimes it can be quite > > annoying. > > > On Jul 16, 7:34 am, Jeremy Burns | Class Outfit > > > wrote: > > > The form helper will automatically create a drop down is there is a > > > variable that is a plural of a field name without it's '_id' at the end. > > > > For example, if you set a variable called $towns in your controller > > > populated by $this->Town->find('list'); and then have a form input called > > > town_id, Cake will link them up and make a drop down called town_id > > > populated with the contents of the $towns array. > > > > I can only presume that you have one such variable that matches a field > > > name, and the rest don't. > > > > What is your desired outcome? Should they all be drop downs (in which > > > case you'll need to set the array variables in your controller) or should > > > they all be inputs (in which case you should add the 'type' => 'text' > > > option to your form input). > > > > Jeremy Burns > > > Class Outfit > > > > jeremybu...@classoutfit.comhttp://www.classoutfit.com > > > > On 16 Jul 2010, at 15:14, spheroid wrote: > > > > > I have a database table that contains child records of another table > > > > and want users to be able to change those child records. The form > > > > helper is doing something strange. I have it loop through my fields > > > > which are varchar, and for some reason one field is creating a select > > > > drop down, all others an input. Why is this happening and how can I > > > > fix it? > > > > > Portion of my view: > > > > > echo $form->input($somestring['MyTableName']['fieldname'], array( > > > > 'div' => false, > > > > 'label' => $somestring['MyTableName'] > > > > ['fieldname_text'], > > > > 'before' => '', > > > > 'between' => ': *', > > > > 'after' => '', > > > > 'size' => 65, > > > > 'default' => $somestring['MyTableName']['setting'] > > > > )); > > > > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelpothers > > > > 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+unsubscr...@googlegroups.com For more options, visit this > > > > group athttp://groups.google.com/group/cake-php?hl=en 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: CakePHP 1.3 Form Helper creating drop down and not input field
The "'type' => 'text'" worked, thanks Jeremy! I wanted all to be inputs. Perfect. On Jul 16, 2:29 pm, Miles J wrote: > Exactly what Jeremy said. I actually ran into this problem yesterday, > I resolved it by just putting "type" => "text". > > Sometimes I love Cakes automagic-ness, sometimes it can be quite > annoying. > > On Jul 16, 7:34 am, Jeremy Burns | Class Outfit > > > > wrote: > > The form helper will automatically create a drop down is there is a > > variable that is a plural of a field name without it's '_id' at the end. > > > For example, if you set a variable called $towns in your controller > > populated by $this->Town->find('list'); and then have a form input called > > town_id, Cake will link them up and make a drop down called town_id > > populated with the contents of the $towns array. > > > I can only presume that you have one such variable that matches a field > > name, and the rest don't. > > > What is your desired outcome? Should they all be drop downs (in which case > > you'll need to set the array variables in your controller) or should they > > all be inputs (in which case you should add the 'type' => 'text' option to > > your form input). > > > Jeremy Burns > > Class Outfit > > > jeremybu...@classoutfit.comhttp://www.classoutfit.com > > > On 16 Jul 2010, at 15:14, spheroid wrote: > > > > I have a database table that contains child records of another table > > > and want users to be able to change those child records. The form > > > helper is doing something strange. I have it loop through my fields > > > which are varchar, and for some reason one field is creating a select > > > drop down, all others an input. Why is this happening and how can I > > > fix it? > > > > Portion of my view: > > > > echo $form->input($somestring['MyTableName']['fieldname'], array( > > > 'div' => false, > > > 'label' => $somestring['MyTableName'] > > > ['fieldname_text'], > > > 'before' => '', > > > 'between' => ': *', > > > 'after' => '', > > > 'size' => 65, > > > 'default' => $somestring['MyTableName']['setting'] > > > )); > > > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp 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+unsubscr...@googlegroups.com For more options, visit this group > > > athttp://groups.google.com/group/cake-php?hl=en 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: CakePHP 1.3 Form Helper creating drop down and not input field
Exactly what Jeremy said. I actually ran into this problem yesterday, I resolved it by just putting "type" => "text". Sometimes I love Cakes automagic-ness, sometimes it can be quite annoying. On Jul 16, 7:34 am, Jeremy Burns | Class Outfit wrote: > The form helper will automatically create a drop down is there is a variable > that is a plural of a field name without it's '_id' at the end. > > For example, if you set a variable called $towns in your controller populated > by $this->Town->find('list'); and then have a form input called town_id, Cake > will link them up and make a drop down called town_id populated with the > contents of the $towns array. > > I can only presume that you have one such variable that matches a field name, > and the rest don't. > > What is your desired outcome? Should they all be drop downs (in which case > you'll need to set the array variables in your controller) or should they all > be inputs (in which case you should add the 'type' => 'text' option to your > form input). > > Jeremy Burns > Class Outfit > > jeremybu...@classoutfit.comhttp://www.classoutfit.com > > On 16 Jul 2010, at 15:14, spheroid wrote: > > > I have a database table that contains child records of another table > > and want users to be able to change those child records. The form > > helper is doing something strange. I have it loop through my fields > > which are varchar, and for some reason one field is creating a select > > drop down, all others an input. Why is this happening and how can I > > fix it? > > > Portion of my view: > > > echo $form->input($somestring['MyTableName']['fieldname'], array( > > 'div' => false, > > 'label' => $somestring['MyTableName'] > > ['fieldname_text'], > > 'before' => '', > > 'between' => ': *', > > 'after' => '', > > 'size' => 65, > > 'default' => $somestring['MyTableName']['setting'] > > )); > > > 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+unsubscr...@googlegroups.com For more options, visit this group > > athttp://groups.google.com/group/cake-php?hl=en 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: CakePHP 1.3 Form Helper creating drop down and not input field
The form helper will automatically create a drop down is there is a variable that is a plural of a field name without it's '_id' at the end. For example, if you set a variable called $towns in your controller populated by $this->Town->find('list'); and then have a form input called town_id, Cake will link them up and make a drop down called town_id populated with the contents of the $towns array. I can only presume that you have one such variable that matches a field name, and the rest don't. What is your desired outcome? Should they all be drop downs (in which case you'll need to set the array variables in your controller) or should they all be inputs (in which case you should add the 'type' => 'text' option to your form input). Jeremy Burns Class Outfit jeremybu...@classoutfit.com http://www.classoutfit.com On 16 Jul 2010, at 15:14, spheroid wrote: > I have a database table that contains child records of another table > and want users to be able to change those child records. The form > helper is doing something strange. I have it loop through my fields > which are varchar, and for some reason one field is creating a select > drop down, all others an input. Why is this happening and how can I > fix it? > > Portion of my view: > > echo $form->input($somestring['MyTableName']['fieldname'], array( >'div' => false, >'label' => $somestring['MyTableName'] > ['fieldname_text'], >'before' => '', >'between' => ': *', >'after' => '', >'size' => 65, >'default' => $somestring['MyTableName']['setting'] >)); > > 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+unsubscr...@googlegroups.com For more options, visit this group at > http://groups.google.com/group/cake-php?hl=en 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
CakePHP 1.3 Form Helper creating drop down and not input field
I have a database table that contains child records of another table and want users to be able to change those child records. The form helper is doing something strange. I have it loop through my fields which are varchar, and for some reason one field is creating a select drop down, all others an input. Why is this happening and how can I fix it? Portion of my view: echo $form->input($somestring['MyTableName']['fieldname'], array( 'div' => false, 'label' => $somestring['MyTableName'] ['fieldname_text'], 'before' => '', 'between' => ': *', 'after' => '', 'size' => 65, 'default' => $somestring['MyTableName']['setting'] )); 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en