[nycphp-talk] Quickform: Select All Checkboxes
David Mintz
dmintz at davidmintz.org
Tue Sep 20 11:59:11 EDT 2005
On Tue, 20 Sep 2005, Tom Melendez wrote:
> Hi Mike,
>
> It's possible that you are asking the question of, "Does QF have
> something built-in for this, or is there a 'Quickform' way of doing
> this?". I use QF and am not familar with their way of handling this.
> Instead, I just output a general javascript function that takes the name
> of the checkbox array and whether to turn them all on or off. Since the
> function is general, it doesn't care if there is one, or 1000. The html
> for the selectall/clearall links and the extra javascript I just add to
> the form with the 'html' element:
>
> $form->addElement('html',$myhtmlstring);
>
> If anyone knows a better way, I'm all ears.
This might not be of interest because it sounds like you are using the
default renderer rather than a template engine. If you're using just the
default renderer and plan to stick with it, the above technique seems ok.
But if you switch to a template engine, the 'html' psuedo-element probably
will not be supported by your renderer, but you will of course have the
ability to put your own javascript directly in the template itself.
---
David Mintz
http://davidmintz.org/
More information about the talk
mailing list