<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Howto: Adding explanations next to form fields with Tableless QuickForm renderer</title>
	<atom:link href="http://www.markwiesemann.eu/2006/12/27/howto-adding-explainations-next-to-form-fields-with-tableless-quickform-renderer/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.markwiesemann.eu/2006/12/27/howto-adding-explainations-next-to-form-fields-with-tableless-quickform-renderer/</link>
	<description></description>
	<lastBuildDate>Sat, 27 Aug 2011 21:07:31 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Mark Wiesemann</title>
		<link>http://www.markwiesemann.eu/2006/12/27/howto-adding-explainations-next-to-form-fields-with-tableless-quickform-renderer/#comment-21909</link>
		<dc:creator>Mark Wiesemann</dc:creator>
		<pubDate>Sat, 27 Aug 2011 21:07:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.markwiesemann.eu/2006/12/27/howto-adding-explainations-next-to-form-fields-with-tableless-quickform-renderer/#comment-21909</guid>
		<description>Alex, if you have created your element via e.g. $element = $frm-&gt;addElement(...), you can call $element-&gt;setAttribute(&#039;class&#039;, &#039;example&#039;) to add a class attribute to the element.

HTML_QuickForm extends the HTML_Common class. Documentation for the setAttribute() method can be found in the HTML_Common API documentation:
http://pear.php.net/package/HTML_Common/docs/latest/HTML_Common/HTML_Common.html</description>
		<content:encoded><![CDATA[<p>Alex, if you have created your element via e.g. $element = $frm->addElement(&#8230;), you can call $element->setAttribute(&#8216;class&#8217;, &#8216;example&#8217;) to add a class attribute to the element.</p>
<p>HTML_QuickForm extends the HTML_Common class. Documentation for the setAttribute() method can be found in the HTML_Common API documentation:<br />
<a href="http://pear.php.net/package/HTML_Common/docs/latest/HTML_Common/HTML_Common.html" rel="nofollow">http://pear.php.net/package/HTML_Common/docs/latest/HTML_Common/HTML_Common.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://www.markwiesemann.eu/2006/12/27/howto-adding-explainations-next-to-form-fields-with-tableless-quickform-renderer/#comment-21839</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Thu, 25 Aug 2011 15:19:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.markwiesemann.eu/2006/12/27/howto-adding-explainations-next-to-form-fields-with-tableless-quickform-renderer/#comment-21839</guid>
		<description>Hi Mark:

I hope this thread is still active.

I want to put a class identifier inside an element of the form rendered with quickform. i.e. inside the input type=submit element  (the button) in order to be able to style the element with css. 

Is this possible?

Should I look for other kind of solution?

I don&#039;t seem to find any information on this.

Thanks in advance and best regards.</description>
		<content:encoded><![CDATA[<p>Hi Mark:</p>
<p>I hope this thread is still active.</p>
<p>I want to put a class identifier inside an element of the form rendered with quickform. i.e. inside the input type=submit element  (the button) in order to be able to style the element with css. </p>
<p>Is this possible?</p>
<p>Should I look for other kind of solution?</p>
<p>I don&#8217;t seem to find any information on this.</p>
<p>Thanks in advance and best regards.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Skinner</title>
		<link>http://www.markwiesemann.eu/2006/12/27/howto-adding-explainations-next-to-form-fields-with-tableless-quickform-renderer/#comment-19</link>
		<dc:creator>Daniel Skinner</dc:creator>
		<pubDate>Fri, 19 Oct 2007 17:16:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.markwiesemann.eu/2006/12/27/howto-adding-explainations-next-to-form-fields-with-tableless-quickform-renderer/#comment-19</guid>
		<description>Yes I have been using that too, its really useful!</description>
		<content:encoded><![CDATA[<p>Yes I have been using that too, its really useful!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Noel</title>
		<link>http://www.markwiesemann.eu/2006/12/27/howto-adding-explainations-next-to-form-fields-with-tableless-quickform-renderer/#comment-18</link>
		<dc:creator>Noel</dc:creator>
		<pubDate>Fri, 19 Oct 2007 08:42:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.markwiesemann.eu/2006/12/27/howto-adding-explainations-next-to-form-fields-with-tableless-quickform-renderer/#comment-18</guid>
		<description>You&#039;re welcome, but I&#039;m not Mark. But he helped me, and I helped you, so it&#039;s been paid forward...

BTW, I&#039;ve overloaded setElementTemplate in my custom renderer (inherits from tableless).

http://phpfi.com/269963

The innovation is simply to allow me to pass an array of elements to set them all to the same custom template.  I find this to be super useful as I am often delegating 3 different templates across my form.

To illustrate the usefulness:

http://phpfi.com/269964

&lt;i&gt;(edited: moved code samples to phpfi.com)&lt;/i&gt;</description>
		<content:encoded><![CDATA[<p>You&#8217;re welcome, but I&#8217;m not Mark. But he helped me, and I helped you, so it&#8217;s been paid forward&#8230;</p>
<p>BTW, I&#8217;ve overloaded setElementTemplate in my custom renderer (inherits from tableless).</p>
<p><a href="http://phpfi.com/269963" rel="nofollow">http://phpfi.com/269963</a></p>
<p>The innovation is simply to allow me to pass an array of elements to set them all to the same custom template.  I find this to be super useful as I am often delegating 3 different templates across my form.</p>
<p>To illustrate the usefulness:</p>
<p><a href="http://phpfi.com/269964" rel="nofollow">http://phpfi.com/269964</a></p>
<p><i>(edited: moved code samples to phpfi.com)</i></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Skinner</title>
		<link>http://www.markwiesemann.eu/2006/12/27/howto-adding-explainations-next-to-form-fields-with-tableless-quickform-renderer/#comment-17</link>
		<dc:creator>Daniel Skinner</dc:creator>
		<pubDate>Fri, 19 Oct 2007 07:47:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.markwiesemann.eu/2006/12/27/howto-adding-explainations-next-to-form-fields-with-tableless-quickform-renderer/#comment-17</guid>
		<description>Mark,

Thank you very much for your quick response.

accept()ing the renderer after calling the validate() function works perfectly. I should have realised that the renderer is a Visitor.

Just to confirm for anyone else who has this problem:
-
If you are having problems with the server side validation messages when using a Renderer make sure that you call:

$form-&gt;validate();

before:

$form-&gt;accept($renderer);</description>
		<content:encoded><![CDATA[<p>Mark,</p>
<p>Thank you very much for your quick response.</p>
<p>accept()ing the renderer after calling the validate() function works perfectly. I should have realised that the renderer is a Visitor.</p>
<p>Just to confirm for anyone else who has this problem:<br />
-<br />
If you are having problems with the server side validation messages when using a Renderer make sure that you call:</p>
<p>$form-&gt;validate();</p>
<p>before:</p>
<p>$form-&gt;accept($renderer);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Skinner</title>
		<link>http://www.markwiesemann.eu/2006/12/27/howto-adding-explainations-next-to-form-fields-with-tableless-quickform-renderer/#comment-16</link>
		<dc:creator>Daniel Skinner</dc:creator>
		<pubDate>Thu, 18 Oct 2007 21:07:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.markwiesemann.eu/2006/12/27/howto-adding-explainations-next-to-form-fields-with-tableless-quickform-renderer/#comment-16</guid>
		<description>I hope that you can shed some light on a problem I am having.
-
I am using the HTML_QuickForm_Renderer_Tableless renderer in the following fashion:
-
-
        $form = $this-&gt;createForm();
        $form-&gt;accept(new HTML_QuickForm_Renderer_Tableless);
        if ($form-&gt;validate())
        {
            return &quot;form valid&quot;;
        } else {
            return $renderer-&gt;toHtml();
        }
-
-
When I submit the form without filling in all required fields, I get the form again (i.e. the form is not valid as expected) but I do not see any error messages.
-
If I simply use: return $form-&gt;toHtml(); I see the error messages but obviously I dont get to use the cool renderer?
-
Is there a known problem with server side validation messages and
HTML_QuickForm_Renderer_Tableless or am I doing something wrong?
-
Please feel free to email me about this one if you prefer(skinner [at] destiny-denied.co.uk)</description>
		<content:encoded><![CDATA[<p>I hope that you can shed some light on a problem I am having.<br />
-<br />
I am using the HTML_QuickForm_Renderer_Tableless renderer in the following fashion:<br />
-<br />
-<br />
        $form = $this-&gt;createForm();<br />
        $form-&gt;accept(new HTML_QuickForm_Renderer_Tableless);<br />
        if ($form-&gt;validate())<br />
        {<br />
            return &#8220;form valid&#8221;;<br />
        } else {<br />
            return $renderer-&gt;toHtml();<br />
        }<br />
-<br />
-<br />
When I submit the form without filling in all required fields, I get the form again (i.e. the form is not valid as expected) but I do not see any error messages.<br />
-<br />
If I simply use: return $form-&gt;toHtml(); I see the error messages but obviously I dont get to use the cool renderer?<br />
-<br />
Is there a known problem with server side validation messages and<br />
HTML_QuickForm_Renderer_Tableless or am I doing something wrong?<br />
-<br />
Please feel free to email me about this one if you prefer(skinner [at] destiny-denied.co.uk)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Noel</title>
		<link>http://www.markwiesemann.eu/2006/12/27/howto-adding-explainations-next-to-form-fields-with-tableless-quickform-renderer/#comment-15</link>
		<dc:creator>Noel</dc:creator>
		<pubDate>Fri, 05 Oct 2007 20:09:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.markwiesemann.eu/2006/12/27/howto-adding-explainations-next-to-form-fields-with-tableless-quickform-renderer/#comment-15</guid>
		<description>Also I have a criticism with static.  There are times when I want to start some html above some elements, and close it after.  Using static doesn&#039;t really allow that because it uses the template which opens and closes wrapping html tags.  Since the html element is deprecated, currently QF doesn&#039;t allow any method other than to override static with a custom template (something you can&#039;t do for types of elements, but merely single instances of elements).  Again this can all get very tedious and defeat the value of QF.</description>
		<content:encoded><![CDATA[<p>Also I have a criticism with static.  There are times when I want to start some html above some elements, and close it after.  Using static doesn&#8217;t really allow that because it uses the template which opens and closes wrapping html tags.  Since the html element is deprecated, currently QF doesn&#8217;t allow any method other than to override static with a custom template (something you can&#8217;t do for types of elements, but merely single instances of elements).  Again this can all get very tedious and defeat the value of QF.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Noel</title>
		<link>http://www.markwiesemann.eu/2006/12/27/howto-adding-explainations-next-to-form-fields-with-tableless-quickform-renderer/#comment-14</link>
		<dc:creator>Noel</dc:creator>
		<pubDate>Fri, 05 Oct 2007 20:05:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.markwiesemann.eu/2006/12/27/howto-adding-explainations-next-to-form-fields-with-tableless-quickform-renderer/#comment-14</guid>
		<description>The approach you outline above is something I am planning to try in the next few days.  One thing I don&#039;t like about it though is it seems tedious and inelegant to have to set the form element template for each and every element, which some forms might call for.  At that point, it really stops being a template doesn&#039;t it?

What could be cool to have would be a setLayout() function that I could call before I call toHtml().  The layout could be html with substitutions for where I want each element to go.  It&#039;s an extra parsing step for QF to perform, but it seems to me the simplest, most straightforward, easiest for non-programmers to edit, way of having a form look exatly how I need it to.</description>
		<content:encoded><![CDATA[<p>The approach you outline above is something I am planning to try in the next few days.  One thing I don&#8217;t like about it though is it seems tedious and inelegant to have to set the form element template for each and every element, which some forms might call for.  At that point, it really stops being a template doesn&#8217;t it?</p>
<p>What could be cool to have would be a setLayout() function that I could call before I call toHtml().  The layout could be html with substitutions for where I want each element to go.  It&#8217;s an extra parsing step for QF to perform, but it seems to me the simplest, most straightforward, easiest for non-programmers to edit, way of having a form look exatly how I need it to.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark Wiesemann</title>
		<link>http://www.markwiesemann.eu/2006/12/27/howto-adding-explainations-next-to-form-fields-with-tableless-quickform-renderer/#comment-13</link>
		<dc:creator>Mark Wiesemann</dc:creator>
		<pubDate>Fri, 05 Oct 2007 09:28:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.markwiesemann.eu/2006/12/27/howto-adding-explainations-next-to-form-fields-with-tableless-quickform-renderer/#comment-13</guid>
		<description>Noel, setFormElementTemplate() can either be called with an element name or without it. If you specify an element name, the given layout string is used only for this element, otherwise it will be used for all elements that don&#039;t have got own layouts.

The &#039;static&#039; and &#039;html&#039; (this one is deprecated) QF elements allow you to add HTML code directly to your form.

Putting a box next to multiple elements might need some hacks. For example, you could group these elements into a fieldset, and use two DIVs in this fieldset. The first DIV for the form elements, the second DIV for the info box.

If you have further questions, please send an email. This comment section is not the best place for such questions.</description>
		<content:encoded><![CDATA[<p>Noel, setFormElementTemplate() can either be called with an element name or without it. If you specify an element name, the given layout string is used only for this element, otherwise it will be used for all elements that don&#8217;t have got own layouts.</p>
<p>The &#8216;static&#8217; and &#8216;html&#8217; (this one is deprecated) QF elements allow you to add HTML code directly to your form.</p>
<p>Putting a box next to multiple elements might need some hacks. For example, you could group these elements into a fieldset, and use two DIVs in this fieldset. The first DIV for the form elements, the second DIV for the info box.</p>
<p>If you have further questions, please send an email. This comment section is not the best place for such questions.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Noel</title>
		<link>http://www.markwiesemann.eu/2006/12/27/howto-adding-explainations-next-to-form-fields-with-tableless-quickform-renderer/#comment-12</link>
		<dc:creator>Noel</dc:creator>
		<pubDate>Fri, 05 Oct 2007 08:17:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.markwiesemann.eu/2006/12/27/howto-adding-explainations-next-to-form-fields-with-tableless-quickform-renderer/#comment-12</guid>
		<description>Mark, thanks for the reply.  I really want to make this work, so I have some follow up questions.

First of all, what do you mean about defining the layout?  As far as I know, I just get to define the template to render a single element, and when QF is rendered into html, it just spits them out all in a row.

Second of all, when I said info box, I meant I needed to have an info box float right while three elements float left.  It would be an info box to describe several elements, not just one, so I&#039;m not sure it works like you explain in this article.

Is there a way I can just intersperse html throughout the quickform?</description>
		<content:encoded><![CDATA[<p>Mark, thanks for the reply.  I really want to make this work, so I have some follow up questions.</p>
<p>First of all, what do you mean about defining the layout?  As far as I know, I just get to define the template to render a single element, and when QF is rendered into html, it just spits them out all in a row.</p>
<p>Second of all, when I said info box, I meant I needed to have an info box float right while three elements float left.  It would be an info box to describe several elements, not just one, so I&#8217;m not sure it works like you explain in this article.</p>
<p>Is there a way I can just intersperse html throughout the quickform?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

