For Programmers: Free Programming Magazines  


Home > Archive > PHP Pear > November 2004 > Re: [PEAR] cloning forms with QuickForm









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] cloning forms with QuickForm
Justin Patrin

2004-11-24, 4:00 pm

On Wed, 24 Nov 2004 15:27:49 +0100, Alberto Mucignat <stain@dxml.org> wrote:
>
> hi all
>
> is there a way to clone a form?
>
> i need to identically replicate a search form at the bottom and at the
> top of the search page, but since I would use ID tags within form
> elements, I need different IDs. should I re-instantiate the object and
> redefining all elements? Any tips/tricks?
>


Hmmm...perhaps HTML_QuickForm should have a __clone() method added to
do this right. The short answer is that there's no good way. If you
really need the search form in two places I would suggest setting the
IDs to something easily replaceable, getting the HTML output, and
doing a str_replace on the part of the IDs which is the same between
all of them for the second form.

--
Justin Patrin
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com