<?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: Password confirmation using Zend Form and Validators</title>
	<atom:link href="http://christiank.org/wp/2010/04/password-confirmation-using-zend-form-and-validators/feed/" rel="self" type="application/rss+xml" />
	<link>http://christiank.org/wp/2010/04/password-confirmation-using-zend-form-and-validators/</link>
	<description>Blog of Christian Kirkegaard</description>
	<lastBuildDate>Sat, 03 Mar 2012 19:13:10 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4-alpha-19931</generator>
	<item>
		<title>By: Owen Corso</title>
		<link>http://christiank.org/wp/2010/04/password-confirmation-using-zend-form-and-validators/comment-page-1/#comment-1787</link>
		<dc:creator>Owen Corso</dc:creator>
		<pubDate>Sat, 03 Mar 2012 19:13:10 +0000</pubDate>
		<guid isPermaLink="false">http://christiank.org/wp/?p=448#comment-1787</guid>
		<description>thanks, just saved me some time!! IOU one O Red Hug :)</description>
		<content:encoded><![CDATA[<p>thanks, just saved me some time!! IOU one O Red Hug :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: PHP Consultant</title>
		<link>http://christiank.org/wp/2010/04/password-confirmation-using-zend-form-and-validators/comment-page-1/#comment-1494</link>
		<dc:creator>PHP Consultant</dc:creator>
		<pubDate>Thu, 14 Apr 2011 14:31:11 +0000</pubDate>
		<guid isPermaLink="false">http://christiank.org/wp/?p=448#comment-1494</guid>
		<description>Nice way, but there is an already existing validator called Zend&lt;em&gt;Validate&lt;/em&gt;Identical

Zend&lt;em&gt;Validate&lt;/em&gt;Identical supports also the comparison of form elements. This can be done by using the element&#039;s name as token. See the following example:

&lt;code&gt;$form-&gt;addElement(&#039;password&#039;, &#039;elementOne&#039;);
$form-&gt;addElement(&#039;password&#039;, &#039;elementTwo&#039;, array(
    &#039;validators&#039; =&gt; array(
        array(&#039;identical&#039;, false, array(&#039;token&#039; =&gt; &#039;elementOne&#039;))
    )
));
&lt;/code&gt;

&quot;
</description>
		<content:encoded><![CDATA[<p>Nice way, but there is an already existing validator called Zend<em>Validate</em>Identical</p>
<p>Zend<em>Validate</em>Identical supports also the comparison of form elements. This can be done by using the element&#8217;s name as token. See the following example:</p>
<p><code>$form-&gt;addElement('password', 'elementOne');<br />
$form-&gt;addElement('password', 'elementTwo', array(<br />
    'validators' =&gt; array(<br />
        array('identical', false, array('token' =&gt; 'elementOne'))<br />
    )<br />
));<br />
</code></p>
<p>&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Christian Kirkegaard</title>
		<link>http://christiank.org/wp/2010/04/password-confirmation-using-zend-form-and-validators/comment-page-1/#comment-904</link>
		<dc:creator>Christian Kirkegaard</dc:creator>
		<pubDate>Fri, 23 Jul 2010 12:45:02 +0000</pubDate>
		<guid isPermaLink="false">http://christiank.org/wp/?p=448#comment-904</guid>
		<description>&lt;p&gt;&lt;/p&gt;&lt;p&gt;the validator doesnt take any arguments. Just parse the validator to your elements&lt;/p&gt;

&lt;p&gt;&lt;pre&gt;
&lt;code&gt;
// more form code here...&lt;br /&gt;
// $password = new Zend&lt;em&gt;Form&lt;/em&gt;Element&lt;em&gt;Password(.....);&lt;br /&gt;
// $confirm = new Zend&lt;/em&gt;Form&lt;em&gt;Element&lt;/em&gt;Password(.....);&lt;br /&gt;
&lt;br /&gt;
$confirmValidator = new My&lt;em&gt;Validate&lt;/em&gt;PasswordConfirmation();&lt;br /&gt;
$password-&gt;addValidator($confirmValidator);&lt;br /&gt;
$confirm-&gt;addValidator($confirmValidator);
&lt;/code&gt;
&lt;/pre&gt;&lt;/p&gt;
</description>
		<content:encoded><![CDATA[</p>
<p>the validator doesnt take any arguments. Just parse the validator to your elements</p>
<p>
<pre>
<code>
// more form code here...
// $password = new Zend<em>Form</em>Element<em>Password(.....);
// $confirm = new Zend</em>Form<em>Element</em>Password(.....);

$confirmValidator = new My<em>Validate</em>PasswordConfirmation();
$password->addValidator($confirmValidator);
$confirm->addValidator($confirmValidator);
</code>
</pre></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: roti</title>
		<link>http://christiank.org/wp/2010/04/password-confirmation-using-zend-form-and-validators/comment-page-1/#comment-903</link>
		<dc:creator>roti</dc:creator>
		<pubDate>Thu, 22 Jul 2010 12:39:37 +0000</pubDate>
		<guid isPermaLink="false">http://christiank.org/wp/?p=448#comment-903</guid>
		<description>Im getting the Not match always, even if I put same passwords in both of the textbox..

My&lt;em&gt;Validate&lt;/em&gt;PasswordConfirmation

const NOT_MATCH = &#039;notMatch&#039;;

&lt;code&gt;    protected $_messageTemplates = array(self::NOT_MATCH =&gt; &#039;Passwords do
&lt;/code&gt;

not match.&#039;);

&lt;code&gt;    public function isValid($value, $context = null)
    {
            $value = (string) $value;
            $this-&gt;_setValue($value);

            if (is_array($context)) {
                    if (isset($context[&#039;confirmation&#039;]) &amp;&amp; ($value ==$context[&#039;confirmation&#039;])) {
                            return true;
                    }
            } elseif (is_string($context) &amp;&amp; ($value == $context)) {
                    return true;
            }

            $this-&gt;_error(self::NOT_MATCH);
            return false;
    }
&lt;/code&gt;

And my Form
 $password = new Zend&lt;em&gt;Form&lt;/em&gt;Element_Password(&#039;passwd&#039;,array(
            &#039;required&#039;  =&gt; true,
            &#039;label&#039;     =&gt; &#039;Password&#039;,
            &#039;size&#039;      =&gt; 11
        ));

&lt;code&gt;    $confirmation = new Zend_Form_Element_Password(&#039;confirmation&#039;,array(
        &#039;required&#039;  =&gt; true,
        &#039;label&#039;     =&gt; &#039;Re-Password&#039;,
        &#039;size&#039;      =&gt; 11
    ));
    //$confirmation-&gt;addValidator(&#039;PasswordConfirmation&#039;,array(&#039;passwd&#039;), true);
&lt;/code&gt;

Could you help me please...
</description>
		<content:encoded><![CDATA[<p>Im getting the Not match always, even if I put same passwords in both of the textbox..</p>
<p>My<em>Validate</em>PasswordConfirmation</p>
<p>const NOT_MATCH = &#8216;notMatch&#8217;;</p>
<p><code>    protected $_messageTemplates = array(self::NOT_MATCH =&gt; 'Passwords do<br />
</code></p>
<p>not match.&#8217;);</p>
<p><code>    public function isValid($value, $context = null)<br />
    {<br />
            $value = (string) $value;<br />
            $this-&gt;_setValue($value);</p>
<p>            if (is_array($context)) {<br />
                    if (isset($context['confirmation']) &amp;&amp; ($value ==$context['confirmation'])) {<br />
                            return true;<br />
                    }<br />
            } elseif (is_string($context) &amp;&amp; ($value == $context)) {<br />
                    return true;<br />
            }</p>
<p>            $this-&gt;_error(self::NOT_MATCH);<br />
            return false;<br />
    }<br />
</code></p>
<p>And my Form<br />
 $password = new Zend<em>Form</em>Element_Password(&#8216;passwd&#8217;,array(<br />
            &#8216;required&#8217;  =&gt; true,<br />
            &#8216;label&#8217;     =&gt; &#8216;Password&#8217;,<br />
            &#8216;size&#8217;      =&gt; 11<br />
        ));</p>
<p><code>    $confirmation = new Zend_Form_Element_Password('confirmation',array(<br />
        'required'  =&gt; true,<br />
        'label'     =&gt; 'Re-Password',<br />
        'size'      =&gt; 11<br />
    ));<br />
    //$confirmation-&gt;addValidator('PasswordConfirmation',array('passwd'), true);<br />
</code></p>
<p>Could you help me please&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Linkpool Nummer 5 &#124; PHP Gangsta - Der PHP Blog</title>
		<link>http://christiank.org/wp/2010/04/password-confirmation-using-zend-form-and-validators/comment-page-1/#comment-825</link>
		<dc:creator>Linkpool Nummer 5 &#124; PHP Gangsta - Der PHP Blog</dc:creator>
		<pubDate>Sat, 17 Apr 2010 08:13:36 +0000</pubDate>
		<guid isPermaLink="false">http://christiank.org/wp/?p=448#comment-825</guid>
		<description>[...] http://christiank.org/wp/2010/04/password-confirmation-using-zend-form-and-validators/ [...]
</description>
		<content:encoded><![CDATA[<p>[...] <a href="http://christiank.org/wp/2010/04/password-confirmation-using-zend-form-and-validators/" rel="nofollow">http://christiank.org/wp/2010/04/password-confirmation-using-zend-form-and-validators/</a> [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marcus</title>
		<link>http://christiank.org/wp/2010/04/password-confirmation-using-zend-form-and-validators/comment-page-1/#comment-814</link>
		<dc:creator>Marcus</dc:creator>
		<pubDate>Fri, 09 Apr 2010 18:52:25 +0000</pubDate>
		<guid isPermaLink="false">http://christiank.org/wp/?p=448#comment-814</guid>
		<description>Original script is from this tutorial by Andrei Nikolov: http://zfsite.andreinikolov.com/2008/05/part-4-zend&lt;em&gt;form-captcha-password-confirmation-date-selector-field-zend&lt;/em&gt;translate/
</description>
		<content:encoded><![CDATA[<p>Original script is from this tutorial by Andrei Nikolov: <a href="http://zfsite.andreinikolov.com/2008/05/part-4-zend" rel="nofollow">http://zfsite.andreinikolov.com/2008/05/part-4-zend</a><em>form-captcha-password-confirmation-date-selector-field-zend</em>translate/</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zend Framework News &#187; Blog Archive &#187; Passwortvalidierung mit Zend_Form und Zend_Validator</title>
		<link>http://christiank.org/wp/2010/04/password-confirmation-using-zend-form-and-validators/comment-page-1/#comment-813</link>
		<dc:creator>Zend Framework News &#187; Blog Archive &#187; Passwortvalidierung mit Zend_Form und Zend_Validator</dc:creator>
		<pubDate>Thu, 08 Apr 2010 12:08:54 +0000</pubDate>
		<guid isPermaLink="false">http://christiank.org/wp/?p=448#comment-813</guid>
		<description>[...] http://christiank.org/wp/2010/04/password-confirmation-using-zend-form-and-validators/ [...]
</description>
		<content:encoded><![CDATA[<p>[...] <a href="http://christiank.org/wp/2010/04/password-confirmation-using-zend-form-and-validators/" rel="nofollow">http://christiank.org/wp/2010/04/password-confirmation-using-zend-form-and-validators/</a> [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cory Wiles</title>
		<link>http://christiank.org/wp/2010/04/password-confirmation-using-zend-form-and-validators/comment-page-1/#comment-807</link>
		<dc:creator>Cory Wiles</dc:creator>
		<pubDate>Tue, 06 Apr 2010 17:08:34 +0000</pubDate>
		<guid isPermaLink="false">http://christiank.org/wp/?p=448#comment-807</guid>
		<description>My friend Jeremy Kendall (http://www.jeremykendall.net) and I worked on this.
</description>
		<content:encoded><![CDATA[<p>My friend Jeremy Kendall (<a href="http://www.jeremykendall.net" rel="nofollow">http://www.jeremykendall.net</a>) and I worked on this.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Weinraub</title>
		<link>http://christiank.org/wp/2010/04/password-confirmation-using-zend-form-and-validators/comment-page-1/#comment-805</link>
		<dc:creator>David Weinraub</dc:creator>
		<pubDate>Tue, 06 Apr 2010 12:31:28 +0000</pubDate>
		<guid isPermaLink="false">http://christiank.org/wp/?p=448#comment-805</guid>
		<description>Nice! 

It would be more general purpose if you could configure the validator with the names of the two password fields. Maybe passed in the constructor?

Thanks for a great snippet. ;-)
</description>
		<content:encoded><![CDATA[<p>Nice! </p>
<p>It would be more general purpose if you could configure the validator with the names of the two password fields. Maybe passed in the constructor?</p>
<p>Thanks for a great snippet. ;-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zend Framework in Action &#187; Christian Kirkegaard: Password confirmation using Zend Form and Validators</title>
		<link>http://christiank.org/wp/2010/04/password-confirmation-using-zend-form-and-validators/comment-page-1/#comment-803</link>
		<dc:creator>Zend Framework in Action &#187; Christian Kirkegaard: Password confirmation using Zend Form and Validators</dc:creator>
		<pubDate>Tue, 06 Apr 2010 09:48:13 +0000</pubDate>
		<guid isPermaLink="false">http://christiank.org/wp/?p=448#comment-803</guid>
		<description>[...] Kirkegaard has posted an article on how to create a password confirmation validator for use with Zend_Form.  A while back i needed a password confirmation field for my users. I looked [...]
</description>
		<content:encoded><![CDATA[<p>[...] Kirkegaard has posted an article on how to create a password confirmation validator for use with Zend_Form.  A while back i needed a password confirmation field for my users. I looked [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>

