<?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: Multiple Forms on a page in Zend Framework</title>
	<atom:link href="http://www.asecondsystem.com/2009/07/28/multiple-forms-on-a-page-in-zend-framework/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.asecondsystem.com/2009/07/28/multiple-forms-on-a-page-in-zend-framework/</link>
	<description>Web Development evolved</description>
	<lastBuildDate>Sat, 26 Jun 2010 19:00:48 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: Nicklas</title>
		<link>http://www.asecondsystem.com/2009/07/28/multiple-forms-on-a-page-in-zend-framework/comment-page-1/#comment-1643</link>
		<dc:creator>Nicklas</dc:creator>
		<pubDate>Wed, 23 Jun 2010 05:09:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.asecondsystem.com/?p=189#comment-1643</guid>
		<description>I wanted the same controller/action, but my solution was to make one more route structure and put in a extra param:
domain.com/controller/action/action2

And to pick up that forms action just if action2 == &quot;thisformsparam&quot;</description>
		<content:encoded><![CDATA[<p>I wanted the same controller/action, but my solution was to make one more route structure and put in a extra param:<br />
domain.com/controller/action/action2</p>
<p>And to pick up that forms action just if action2 == &#8220;thisformsparam&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jamshid</title>
		<link>http://www.asecondsystem.com/2009/07/28/multiple-forms-on-a-page-in-zend-framework/comment-page-1/#comment-1475</link>
		<dc:creator>Jamshid</dc:creator>
		<pubDate>Mon, 07 Jun 2010 11:58:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.asecondsystem.com/?p=189#comment-1475</guid>
		<description>It&#039;s Just I need it. I&#039;d also this problem.
But it&#039;s very nice. Forms are working.
Thanks to Dwamian Mcleish.</description>
		<content:encoded><![CDATA[<p>It&#8217;s Just I need it. I&#8217;d also this problem.<br />
But it&#8217;s very nice. Forms are working.<br />
Thanks to Dwamian Mcleish.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bzz</title>
		<link>http://www.asecondsystem.com/2009/07/28/multiple-forms-on-a-page-in-zend-framework/comment-page-1/#comment-1455</link>
		<dc:creator>bzz</dc:creator>
		<pubDate>Fri, 04 Jun 2010 13:22:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.asecondsystem.com/?p=189#comment-1455</guid>
		<description>Very good. Thank you both. Dwamian Mcleish, you have just forgotten to add your hidden element : 
$this-&gt;addElements(array($process));
Otherwise it works very well.</description>
		<content:encoded><![CDATA[<p>Very good. Thank you both. Dwamian Mcleish, you have just forgotten to add your hidden element :<br />
$this-&gt;addElements(array($process));<br />
Otherwise it works very well.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dwamian Mcleish</title>
		<link>http://www.asecondsystem.com/2009/07/28/multiple-forms-on-a-page-in-zend-framework/comment-page-1/#comment-1132</link>
		<dc:creator>Dwamian Mcleish</dc:creator>
		<pubDate>Thu, 15 Apr 2010 18:13:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.asecondsystem.com/?p=189#comment-1132</guid>
		<description>You solution above works well but how about we simplify the process a bit. How do you feel about this?

Back in the day we use to just put hidden fields in our form and check if it &quot;isset&#039; when it comes time to process the form. How about just adding a hidden field in your form e.g

&lt;code&gt;//form process flag in case multiple forms
		$process = new Zend_Form_Element_Hidden ( &#039;process_signup&#039; );
		$process-&gt;setValue(true);&lt;/code&gt;

then check it in the controller to make sure it exists..e.g

&lt;code&gt;
//try to grab the form data
		@$formData = $this-&gt;getRequest ()-&gt;getPost ();
		if ($this-&gt;getRequest ()-&gt;isPost () &amp;&amp; isset($formData[&#039;process_signup&#039;])) {...only do all the validation and processing here..}
&lt;/code&gt;

That way forms can co-exist without a lot of back and forth processing and messing with the registry. 

What are your arguments against this method?</description>
		<content:encoded><![CDATA[<p>You solution above works well but how about we simplify the process a bit. How do you feel about this?</p>
<p>Back in the day we use to just put hidden fields in our form and check if it &#8220;isset&#8217; when it comes time to process the form. How about just adding a hidden field in your form e.g</p>
<p><code>//form process flag in case multiple forms<br />
		$process = new Zend_Form_Element_Hidden ( 'process_signup' );<br />
		$process-&gt;setValue(true);</code></p>
<p>then check it in the controller to make sure it exists..e.g</p>
<p><code><br />
//try to grab the form data<br />
		@$formData = $this-&gt;getRequest ()-&gt;getPost ();<br />
		if ($this-&gt;getRequest ()-&gt;isPost () &amp;&amp; isset($formData['process_signup'])) {...only do all the validation and processing here..}<br />
</code></p>
<p>That way forms can co-exist without a lot of back and forth processing and messing with the registry. </p>
<p>What are your arguments against this method?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced) (user agent is rejected)
Database Caching using disk

Served from: www.asecondsystem.com @ 2010-09-08 20:36:39 -->