Home > Archive > PHP Pear > May 2005 > Re: [PEAR] horizontal formbuilder
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Re: [PEAR] horizontal formbuilder
|
|
| Justin Patrin 2005-05-26, 8:59 pm |
| On 5/20/05, Andrew Wooldridge <andrew.r.wooldridge@vanderbilt.edu> wrote:
> Justin et. al, please advise.
>=20
> Currently writing a form using formbuilder to insert multiple rows in a
> single table with one form using the useForm() method. Look at the
> example below of what I want the form to look like. Should I write my
> own getForm(), or is there a way to customize with
> pre/postGenerateForm() to output everything horizontally on one line?
>=20
> Thanks! -Andy
>=20
> I want the HTML code to look like:
> <tr>
> <td align=3D"right" valign=3D"top"><b>Checkbox1</b></td>
> <td align=3D"right" valign=3D"top"><b>Checkbox2</b></td>
> <td align=3D"right" valign=3D"top"><b>Checkbox3</b></td>
> </tr>
>=20
> <tr>
> <td valign=3D"top" align=3D"left"><input name=3D"field1[=
1]"
> type=3D"checkbox" value=3D"1" id=3D"qf_6dd127" /></td>
> <td valign=3D"top" align=3D"left"><input name=3D"field2[=
1]"
> type=3D"checkbox" value=3D"1" id=3D"qf_d0b905" /></td>
> <td valign=3D"top" align=3D"left"><input name=3D"field3[=
1]"
> type=3D"checkbox" value=3D"1" id=3D"qf_030dd7" /></td>
> </tr>
>=20
> <tr>
> <td valign=3D"top" align=3D"left"><input name=3D"field1[=
2]"
> type=3D"checkbox" value=3D"1" id=3D"qf_6dd127" /></td>
> <td valign=3D"top" align=3D"left"><input name=3D"field2[=
2]"
> type=3D"checkbox" value=3D"1" id=3D"qf_d0b905" /></td>
> <td valign=3D"top" align=3D"left"><input name=3D"field3[=
2]"
> type=3D"checkbox" value=3D"1" id=3D"qf_030dd7" /></td>
> </tr>
>=20
> <tr>
> <td align=3D"right" valign=3D"top"><b></b></td>
> <td valign=3D"top" align=3D"left"><input name=3D"__submi=
t__"
> value=3D"Submit" type=3D"submit" /></td>
> </tr>
>=20
>=20
>=20
>=20
> Not like FormBuilder default getForm which outputs:
> <tr>
> <td align=3D"right" valign=3D"top"><b>Checkbox1</b></td>
> <td valign=3D"top" align=3D"left"><input name=3D"field1[=
1]"
> type=3D"checkbox" value=3D"1" id=3D"qf_6dd127" /></td>
> </tr>
> <tr>
> <td align=3D"right" valign=3D"top"><b>Checkbox2</b></td>
> <td valign=3D"top" align=3D"left"><input name=3D"field2[=
1]"
> type=3D"checkbox" value=3D"1" id=3D"qf_d0b905" /></td>
> </tr>
> <tr>
> <td align=3D"right" valign=3D"top"><b>Checkbox3</b></td>
> <td valign=3D"top" align=3D"left"><input name=3D"field3[=
1]"
> type=3D"checkbox" value=3D"1" id=3D"qf_030dd7" /></td>
> </tr>
>=20
> <tr>
> <td align=3D"right" valign=3D"top"><b>Checkbox1</b></td>
> <td valign=3D"top" align=3D"left"><input name=3D"field1[=
2]"
> type=3D"checkbox" value=3D"1" id=3D"qf_6dd127" /></td>
> </tr>
> <tr>
> <td align=3D"right" valign=3D"top"><b>Checkbox2</b></td>
> <td valign=3D"top" align=3D"left"><input name=3D"field2[=
2]"
> type=3D"checkbox" value=3D"1" id=3D"qf_d0b905" /></td>
> </tr>
> <tr>
> <td align=3D"right" valign=3D"top"><b>Checkbox3</b></td>
> <td valign=3D"top" align=3D"left"><input name=3D"field3[=
2]"
> type=3D"checkbox" value=3D"1" id=3D"qf_030dd7" /></td>
> </tr>
>=20
> <tr>
> <td align=3D"right" valign=3D"top"><b></b></td>
> <td valign=3D"top" align=3D"left"><input name=3D"__submi=
t__"
> value=3D"Submit" type=3D"submit" /></td>
> </tr>
>=20
First and foremost, FormBuilder doesn't support elements with [ or ]
in their names, Second, FormBuilder builds forms for DB_DataObjects
and I've never seen a field name in a DB with [ or ] in it.
Third, what you're building here looks like a tripleLink. I suggest
you look more into that. The Audio Formats element on th epage below
is a tripleLink:
http://pear.reversefold.com/
You can get an example here:
http://pear.reversefold.com/example.tgz
--=20
Justin Patrin
| |
| Andrew Wooldridge 2005-05-26, 8:59 pm |
| On May 20, 2005, at 6:10 PM, Justin Patrin wrote:
> On 5/20/05, Andrew Wooldridge <andrew.r.wooldridge@vanderbilt.edu>
> wrote:
>
> First and foremost, FormBuilder doesn't support elements with [ or ]
> in their names, Second, FormBuilder builds forms for DB_DataObjects
> and I've never seen a field name in a DB with [ or ] in it.
>
> Third, what you're building here looks like a tripleLink. I suggest
> you look more into that. The Audio Formats element on th epage below
> is a tripleLink:
> http://pear.reversefold.com/
>
> You can get an example here:
> http://pear.reversefold.com/example.tgz
>
> --
> Justin Patrin
>
>
Thanks for the pointers.
You're absolutely correct about the bracket characters. I was
modifying the names of the dataobject elements to make an HTML array
per the first example on this page:
http://lists.nyphp.org/pipermail/fr...ry/000196.html.
I think tripleLink is the more elegant solution that I'm looking for.
Follow-up Question: If I need more field types than just checkboxes in
each row, then I should use crosslinks, like the 'Songs' in your
example?
-A
|
|
|
|
|