AW: [PEAR] Radio buttons and Quickform
| From: | Mirco Blitz | Date: | Wed, 15 Dec 2004 01:43:30 +0000 |
| Subject: | AW: [PEAR] Radio buttons and Quickform | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-16237@lists.php.net to get a copy of this message | ||
Hi Mos,
Its just another method to assign a radiobutton.
$radio1[]=&HTML_QuickForm::createElement('radio','t_pub','test','No','no'
);
The &HTML_QuickForm::createElement does the same as $form_edit->addElement.
Only that you dont assign the Button to the Form directly, but to an array,
that can be added with $form->addGroup.
You can use all possible fields for a group and you may mix up fields types
as well. All Groups are given back in HTML code as "one line".
You later can access the radiobutton data with $_POST["t_pub_gr"]["t_pub"]
for example, as far as your form is post method of course.
Greetings
Mirco
-----Ursprüngliche Nachricht-----
Von: Mos [mailto:mos_fr@yahoo.fr]
Gesendet: Dienstag, 14. Dezember 2004 23:05
An: pear-general@lists.php.net
Betreff: Re: [PEAR] Radio buttons and Quickform
Ok I will try this !
But I read what I used at
http://www.devarticles.com/c/a/Web-Graphic-Design/Using-HTML-Quickform-for-F
orm-Processing/5/
in the radio section.
Is it obsolete to use radio buttons with this described method ?
Mos
"Mirco Blitz" <webmaster@lindworm.de> a écrit dans le message de
news:200412141149.iBEBnr4Q024988@irma.ab-space.de...
Hi Mos,
you have to use Groups fort hat. Like this.
$radio1[]=&HTML_QuickForm::createElement('radio','t_pub','test','No','no'
);
$radio1[] =
&HTML_QuickForm::createElement('radio','t_pub',null,'No','no');
$form->addGroup($radio1, 't_pub_gr', 'Yes / No');
{$form_data2.t_pub_gr.html}{$form_data2.t_pub_gr.label}
Have Fun
Mirco
-----Ursprüngliche Nachricht-----
Von: Mos [mailto:mos_fr@yahoo.fr]
Gesendet: Dienstag, 14. Dezember 2004 08:17
An: pear-general@lists.php.net
Betreff: [PEAR] Radio buttons and Quickform
Hi everybody
I have a code using radio buttons in a quickform, but it does not works.
Does anybody have a code snippets which is pretty good, just to see what I
have forgotten... ?
I use :
$form_edit->addElement('radio', 't_pub', 'test','No',
'no','');
$form_edit->addElement('radio', 't_pub', null,'No',
'no','');
with a template based on
{$form_data2.t_pub.html}{$form_data2.t_pub.label}
but without success
Thanks
Mos
--
PEAR General Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PEAR General Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php