Re: Attribute "for" in label tag with QuickForm and Renderer_ITDynamic
| From: | Justin Patrin | Date: | Sat, 22 Oct 2005 18:31:51 +0000 |
| Subject: | Re: Attribute "for" in label tag with QuickForm and Renderer_ITDynamic | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-21599@lists.php.net to get a copy of this message | ||
On 10/22/05, Pierre-Yves Stucki <pierre-yves.stucki@inxl6.org> wrote:
> References: <72caf6432e6ba35e071a9e01fe206238@electroteque.org>
> <d20e950d3730cc6598ef0314c4261d13@electroteque.org>
> In-Reply-To: <d20e950d3730cc6598ef0314c4261d13@electroteque.org>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
> Content-Transfer-Encoding: 7bit
>
These are e-mail headers saying that you replied to someone else's
message to create your own. Please check to make sure that your e-mail
client is functioning properly. We shouldn't be seeing headers in the
body of your e-mail. Please also do not reply to someone else's
message to create a new thread. Create a completely new e-mail in your
client.
>
> Hello,
>
> I'm creating a form with QuickForm and Renderer_ITDynamic. Everything
> works really fine, excepted one point : I can't find how to create the
> "for" attribute in the "label" tag.
>
>
> Basically, I create the element this way :
>
> $form->addElement('text', 'post_commune', 'Commune :',
> array('id'=>'post_commune'));
>
> In my template, I place this :
>
> <label>{qf_label}</label>
> {qf_element}
>
> And the resulting HTML output is :
>
> <label>Commune :</label>
> <input id="post_commune" name="post_commune" type="text"
> />
>
The easiest solution is to use:
<label>
{qf_label}
{qf_element}
</label>
This way the label is tied to that element. If you use this syntax you
don't need the for="" at all. This will *only* work if there is one
element in {qf_element}. If it's a group of elements this will behave
very strangely and/or crash your browser.
>
> What should I add (in PHP or in template) in order to have the following
> output :
>
> <label for="post_commune">Commune :</label>
> <input id="post_commune" name="post_commune" type="text"
> />
>
>
> I couldn't fin any documentation on that point in PEAR manual or in
> forums...
>
This *should* be possible, but I know nothing about the ITDynamic
renderer or IT templates, so I can't help you.
--
Justin Patrin