<?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: Zend Framework and hidden fields</title>
	<atom:link href="http://blog.motane.lu/2009/02/17/zend-framework-and-hidden-fields/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.motane.lu/2009/02/17/zend-framework-and-hidden-fields/</link>
	<description>Ramblings about software development</description>
	<lastBuildDate>Thu, 02 Feb 2012 17:38:29 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Atef</title>
		<link>http://blog.motane.lu/2009/02/17/zend-framework-and-hidden-fields/comment-page-1/#comment-4790</link>
		<dc:creator>Atef</dc:creator>
		<pubDate>Mon, 23 Jan 2012 14:34:25 +0000</pubDate>
		<guid isPermaLink="false">http://blog.motane.lu/?p=275#comment-4790</guid>
		<description>i force the hidden value of the checked input to 1 :
[code lang=&quot;javascript&quot;]
$(&#039;.checkbox&#039;).each(function(){

		if($(this).attr(&#039;checked&#039;) == true){
				$(this).prev(&#039;input&#039;).val(&#039;1&#039;);
			}else{
				$(this).prev(&#039;input&#039;).val(&#039;0&#039;);
			}

	});
[/code]</description>
		<content:encoded><![CDATA[<p>i force the hidden value of the checked input to 1 :</p>
<pre class="brush: jscript; title: ; notranslate">
$('.checkbox').each(function(){

		if($(this).attr('checked') == true){
				$(this).prev('input').val('1');
			}else{
				$(this).prev('input').val('0');
			}

	});
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adolfo</title>
		<link>http://blog.motane.lu/2009/02/17/zend-framework-and-hidden-fields/comment-page-1/#comment-2220</link>
		<dc:creator>Adolfo</dc:creator>
		<pubDate>Thu, 14 Apr 2011 13:14:48 +0000</pubDate>
		<guid isPermaLink="false">http://blog.motane.lu/?p=275#comment-2220</guid>
		<description>nice one, thanks!</description>
		<content:encoded><![CDATA[<p>nice one, thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kwiaty przez internet</title>
		<link>http://blog.motane.lu/2009/02/17/zend-framework-and-hidden-fields/comment-page-1/#comment-1646</link>
		<dc:creator>kwiaty przez internet</dc:creator>
		<pubDate>Thu, 23 Dec 2010 08:18:26 +0000</pubDate>
		<guid isPermaLink="false">http://blog.motane.lu/?p=275#comment-1646</guid>
		<description>Fantastic job dude. Cool.</description>
		<content:encoded><![CDATA[<p>Fantastic job dude. Cool.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lizozom</title>
		<link>http://blog.motane.lu/2009/02/17/zend-framework-and-hidden-fields/comment-page-1/#comment-1572</link>
		<dc:creator>Lizozom</dc:creator>
		<pubDate>Thu, 02 Dec 2010 10:51:10 +0000</pubDate>
		<guid isPermaLink="false">http://blog.motane.lu/?p=275#comment-1572</guid>
		<description>Thank you!
Very helpful!</description>
		<content:encoded><![CDATA[<p>Thank you!<br />
Very helpful!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jurian Sluiman</title>
		<link>http://blog.motane.lu/2009/02/17/zend-framework-and-hidden-fields/comment-page-1/#comment-1570</link>
		<dc:creator>Jurian Sluiman</dc:creator>
		<pubDate>Wed, 24 Nov 2010 14:08:24 +0000</pubDate>
		<guid isPermaLink="false">http://blog.motane.lu/?p=275#comment-1570</guid>
		<description>I found another way to change the  html tag into one with a class=&quot;hidden&quot;. In your method you loop through all elements, which can cost a lot when you use large forms. Also with subforms the method doesn&#039;t really work well.

I override the loadDefaultDecorators for the Zend_Form_Element_Hidden which gives the opportunity to add the class directly when the hidden elements are added (and not only when rendered).

Because it&#039;s too long to post the whole story, here&#039;s just the link to my blog post:
http://juriansluiman.nl/en/blog/article/106/hide-hidden-zend_form-elements</description>
		<content:encoded><![CDATA[<p>I found another way to change the  html tag into one with a class=&#8221;hidden&#8221;. In your method you loop through all elements, which can cost a lot when you use large forms. Also with subforms the method doesn&#8217;t really work well.</p>
<p>I override the loadDefaultDecorators for the Zend_Form_Element_Hidden which gives the opportunity to add the class directly when the hidden elements are added (and not only when rendered).</p>
<p>Because it&#8217;s too long to post the whole story, here&#8217;s just the link to my blog post:<br />
<a href="http://juriansluiman.nl/en/blog/article/106/hide-hidden-zend_form-elements" rel="nofollow">http://juriansluiman.nl/en/blog/article/106/hide-hidden-zend_form-elements</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Croma</title>
		<link>http://blog.motane.lu/2009/02/17/zend-framework-and-hidden-fields/comment-page-1/#comment-1550</link>
		<dc:creator>Croma</dc:creator>
		<pubDate>Sun, 24 Oct 2010 22:31:34 +0000</pubDate>
		<guid isPermaLink="false">http://blog.motane.lu/?p=275#comment-1550</guid>
		<description>Really helpful info.

I too like to get my pages validated.

Thanks</description>
		<content:encoded><![CDATA[<p>Really helpful info.</p>
<p>I too like to get my pages validated.</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: LC</title>
		<link>http://blog.motane.lu/2009/02/17/zend-framework-and-hidden-fields/comment-page-1/#comment-1374</link>
		<dc:creator>LC</dc:creator>
		<pubDate>Thu, 17 Jun 2010 10:42:37 +0000</pubDate>
		<guid isPermaLink="false">http://blog.motane.lu/?p=275#comment-1374</guid>
		<description>I use ...
[code lang=&quot;php&quot;]
-&gt;removeDecorator(&#039;label&#039;)
-&gt;removeDecorator(&#039;HtmlTag&#039;);
[/code]
... stacked and it works, for hidden and hash elements.

I don&#039;t care if it does not validate.</description>
		<content:encoded><![CDATA[<p>I use &#8230;</p>
<pre class="brush: php; title: ; notranslate">
-&gt;removeDecorator('label')
-&gt;removeDecorator('HtmlTag');
</pre>
<p>&#8230; stacked and it works, for hidden and hash elements.</p>
<p>I don&#8217;t care if it does not validate.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Exception e</title>
		<link>http://blog.motane.lu/2009/02/17/zend-framework-and-hidden-fields/comment-page-1/#comment-1280</link>
		<dc:creator>Exception e</dc:creator>
		<pubDate>Tue, 20 Apr 2010 13:44:13 +0000</pubDate>
		<guid isPermaLink="false">http://blog.motane.lu/?p=275#comment-1280</guid>
		<description>@Iacovos Constantinou Thank you!</description>
		<content:encoded><![CDATA[<p>@Iacovos Constantinou Thank you!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Iacovos Constantinou</title>
		<link>http://blog.motane.lu/2009/02/17/zend-framework-and-hidden-fields/comment-page-1/#comment-1270</link>
		<dc:creator>Iacovos Constantinou</dc:creator>
		<pubDate>Wed, 31 Mar 2010 17:53:27 +0000</pubDate>
		<guid isPermaLink="false">http://blog.motane.lu/?p=275#comment-1270</guid>
		<description>You should use ViewHelper and HtmlTag decorators in order to achieve this. The following piece of code will completely ignore the label tag (incl. the dl) and it will generate both the dd and input tags.

[sourcecode lang=&quot;php&quot;]
class Zend_View_Helper_StripHidden {
    public function stripHidden( Zend_Form $_form ) {
        foreach( $_form-&gt;getElements() as $element ) {
            if( $element instanceof Zend_Form_Element_Hidden ) {
				$element-&gt;setDecorators(array(
				    &#039;ViewHelper&#039;,
				    array(&#039;HtmlTag&#039;, array(&#039;tag&#039; =&gt; &#039;dd&#039;, &#039;class&#039; =&gt;&#039;hidden&#039;)),
				));
            }
        }
      
        return $_form;
    }
}
[/sourcecode]</description>
		<content:encoded><![CDATA[<p>You should use ViewHelper and HtmlTag decorators in order to achieve this. The following piece of code will completely ignore the label tag (incl. the dl) and it will generate both the dd and input tags.</p>
<pre class="brush: php; title: ; notranslate">
class Zend_View_Helper_StripHidden {
    public function stripHidden( Zend_Form $_form ) {
        foreach( $_form-&gt;getElements() as $element ) {
            if( $element instanceof Zend_Form_Element_Hidden ) {
				$element-&gt;setDecorators(array(
				    'ViewHelper',
				    array('HtmlTag', array('tag' =&gt; 'dd', 'class' =&gt;'hidden')),
				));
            }
        }

        return $_form;
    }
}
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Exception e</title>
		<link>http://blog.motane.lu/2009/02/17/zend-framework-and-hidden-fields/comment-page-1/#comment-1266</link>
		<dc:creator>Exception e</dc:creator>
		<pubDate>Fri, 26 Mar 2010 15:49:09 +0000</pubDate>
		<guid isPermaLink="false">http://blog.motane.lu/?p=275#comment-1266</guid>
		<description>@Tudor with &quot;last solution&quot;  I meant your comment above http://blog.motane.lu/2009/02/17/zend-framework-and-hidden-fields/comment-page-1/#comment-1053</description>
		<content:encoded><![CDATA[<p>@Tudor with &#8220;last solution&#8221;  I meant your comment above <a href="http://blog.motane.lu/2009/02/17/zend-framework-and-hidden-fields/comment-page-1/#comment-1053" rel="nofollow">http://blog.motane.lu/2009/02/17/zend-framework-and-hidden-fields/comment-page-1/#comment-1053</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>

