Does anyone know whether FAPI can create repeating input fields of the form: <input name="myfiled[]"/> <input name="myfield[]"/> Or some such equivalent. I'd like the stuff returned in a $form_values['myfield'] variable as an array of values I'm thinking about doing a custom helper function to accomplish this but would love to hear best some ideas about how to approach this. Dave
On Jan 10, 2008, at 6:49 AM, David Metzler wrote:
I'd like the stuff returned in a $form_values['myfield'] variable as an array of values
I believe you're looking for: '#tree' => TRUE no? Check the FAPI docs for details... -Derek (dww)
Yes that's exactly what I needed.... Skipped over tree just cause I thought it was more related to well trees. But now I see how that concept applies. Thanks again, Dave On Jan 10, 2008, at 10:22 AM, Derek Wright wrote:
On Jan 10, 2008, at 6:49 AM, David Metzler wrote:
I'd like the stuff returned in a $form_values['myfield'] variable as an array of values
I believe you're looking for:
'#tree' => TRUE
no?
Check the FAPI docs for details...
-Derek (dww)
http://drupal.org/node/48643 ??? huge hug Feijó ----- Original Message ----- From: "David Metzler" <metzlerd@metzlerd.com> To: <development@drupal.org> Sent: Thursday, January 10, 2008 12:49 PM Subject: [development] Forms API and Array
Does anyone know whether FAPI can create repeating input fields of the form:
<input name="myfiled[]"/> <input name="myfield[]"/>
Or some such equivalent. I'd like the stuff returned in a $form_values['myfield'] variable as an array of values
I'm thinking about doing a custom helper function to accomplish this but would love to hear best some ideas about how to approach this.
Dave
http://drupal.org/node/48643 ??? yes
participants (4)
-
Alessandro Feijó -
David Metzler -
Derek Wright -
Karoly Negyesi