|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
painsek Smarty n00b
Joined: 17 Jun 2004 Posts: 1
|
Posted: Thu Jun 17, 2004 3:20 pm Post subject: pear quickform radio buttons with smarty |
|
|
Hello all!!
I started a website, I am using a framework with phplib DB for the database library, PEAR Quickform for the form validation, and Smarty for the templates.
I have made a form that I render with Pear's HTML_QuickForm_Renderer_ArraySmarty()
Into this form I wanted to put a "what is your sex" radio element. From the doc, I see that I must create 2 radio elements, with the same ID:
the php code is:
$form->addElement('radio', 'sex', '<b>You are </b>...', 'a woman', 2);
$form->addElement('radio', 'sex', '<b>You are </b>...', 'a man', 1);
So the user can only select one of the two options.
and the template code is, as usual:
{$form_data.sex.label}
{$form_data.sex.html}
I must add that I use several other Quickform elements in this form, and they work perfect, but this radio element doesn't produce anything (no HTML is generated)
So I must have made a mistake in my radio element definition, but I can't find which one!!!
Can anyone help me?
Thanks a lot |
|
Back to top |
|
Sal Smarty n00b
Joined: 06 Oct 2004 Posts: 1
|
Posted: Wed Oct 06, 2004 9:15 pm Post subject: |
|
|
Yea, I am having the same problem, I know it has something to do with a foreach loop, i just dont know how to write it out.
how someone can help.
-- Sal |
|
Back to top |
|
dan.klasson Smarty n00b
Joined: 17 Apr 2011 Posts: 3
|
Posted: Sun Apr 17, 2011 3:27 pm Post subject: |
|
|
In your case, since the last parameters you pass are integers:
{$form_data.sex.1.label}
{$form_data.sex.1.html}
{$form_data.sex.2.label}
{$form_data.sex.2.html} |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|