<?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: Validating Flex forms using the Validator classes</title>
	<atom:link href="http://blog.flexexamples.com/2007/08/13/validating-flex-forms-using-the-validator-classes/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.flexexamples.com/2007/08/13/validating-flex-forms-using-the-validator-classes/</link>
	<description>Just a bunch of Adobe Flex Examples</description>
	<lastBuildDate>Sun, 12 Feb 2012 14:19:03 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: James</title>
		<link>http://blog.flexexamples.com/2007/08/13/validating-flex-forms-using-the-validator-classes/comment-page-1/#comment-10086</link>
		<dc:creator>James</dc:creator>
		<pubDate>Mon, 24 Oct 2011 18:07:53 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/08/13/validating-flex-forms-using-the-validator-classes/#comment-10086</guid>
		<description>Hi Peter,

When I use your code in a flex3 project, it works fine.
But when I use flex 4 code I get an error from this line:
 var errField:String = FormItem(err.currentTarget.source.parent).label

=&gt; TypeError: Error #1034: Type Coercion failed: cannot convert spark.components::Group@115cad0a1 to spark.components.FormItem

Any tips to solve this ?

Thanks in advance,
James</description>
		<content:encoded><![CDATA[<p>Hi Peter,</p>
<p>When I use your code in a flex3 project, it works fine.<br />
But when I use flex 4 code I get an error from this line:<br />
 var errField:String = FormItem(err.currentTarget.source.parent).label</p>
<p>=&gt; TypeError: Error #1034: Type Coercion failed: cannot convert spark.components::Group@115cad0a1 to spark.components.FormItem</p>
<p>Any tips to solve this ?</p>
<p>Thanks in advance,<br />
James</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Wally Kolcz</title>
		<link>http://blog.flexexamples.com/2007/08/13/validating-flex-forms-using-the-validator-classes/comment-page-1/#comment-9060</link>
		<dc:creator>Wally Kolcz</dc:creator>
		<pubDate>Thu, 17 Mar 2011 00:40:21 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/08/13/validating-flex-forms-using-the-validator-classes/#comment-9060</guid>
		<description>How can you validate a DropDownList to not be -1 but can be -3 (If the enter thier own value) and incorporate it into your loop? Thanks! This article was perfect for me!</description>
		<content:encoded><![CDATA[<p>How can you validate a DropDownList to not be -1 but can be -3 (If the enter thier own value) and incorporate it into your loop? Thanks! This article was perfect for me!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vikas</title>
		<link>http://blog.flexexamples.com/2007/08/13/validating-flex-forms-using-the-validator-classes/comment-page-1/#comment-8595</link>
		<dc:creator>Vikas</dc:creator>
		<pubDate>Fri, 03 Dec 2010 10:01:35 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/08/13/validating-flex-forms-using-the-validator-classes/#comment-8595</guid>
		<description>Can we just show labels in red, exactly we see when we do mouse over on field, while pressing on submit button, instead of displaying annoying Alert!

Like we see in jQuery validation plug-in, if anyone had experience of it.</description>
		<content:encoded><![CDATA[<p>Can we just show labels in red, exactly we see when we do mouse over on field, while pressing on submit button, instead of displaying annoying Alert!</p>
<p>Like we see in jQuery validation plug-in, if anyone had experience of it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter deHaan</title>
		<link>http://blog.flexexamples.com/2007/08/13/validating-flex-forms-using-the-validator-classes/comment-page-1/#comment-8119</link>
		<dc:creator>Peter deHaan</dc:creator>
		<pubDate>Thu, 15 Jul 2010 22:25:22 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/08/13/validating-flex-forms-using-the-validator-classes/#comment-8119</guid>
		<description>@Monte Aspevig,

Not sure if it is exactly the same issue (or whether you&#039;re using Flex 3.x or 4.x), but you may want to check out http://bugs.adobe.com/jira/browse/SDK-25731 and possibly download the latest Flex 3.6 nightly build from http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+3 and see if that solves the issue.

Peter</description>
		<content:encoded><![CDATA[<p>@Monte Aspevig,</p>
<p>Not sure if it is exactly the same issue (or whether you&#8217;re using Flex 3.x or 4.x), but you may want to check out <a href="http://bugs.adobe.com/jira/browse/SDK-25731" rel="nofollow">http://bugs.adobe.com/jira/browse/SDK-25731</a> and possibly download the latest Flex 3.6 nightly build from <a href="http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+3" rel="nofollow">http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+3</a> and see if that solves the issue.</p>
<p>Peter</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Monte Aspevig</title>
		<link>http://blog.flexexamples.com/2007/08/13/validating-flex-forms-using-the-validator-classes/comment-page-1/#comment-8115</link>
		<dc:creator>Monte Aspevig</dc:creator>
		<pubDate>Thu, 15 Jul 2010 19:24:18 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/08/13/validating-flex-forms-using-the-validator-classes/#comment-8115</guid>
		<description>When using the control.errorString = &quot;&quot;; to reset the form, it appears the required field validation stops working.  Neither submitting the form nor tabbing through the fields and leaving a required field blank will trigger the red-outline and tool-top functionality of the form field after setting its errorString property to &quot;&quot;.</description>
		<content:encoded><![CDATA[<p>When using the control.errorString = &#8220;&#8221;; to reset the form, it appears the required field validation stops working.  Neither submitting the form nor tabbing through the fields and leaving a required field blank will trigger the red-outline and tool-top functionality of the form field after setting its errorString property to &#8220;&#8221;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shankar Ganesh</title>
		<link>http://blog.flexexamples.com/2007/08/13/validating-flex-forms-using-the-validator-classes/comment-page-1/#comment-7434</link>
		<dc:creator>Shankar Ganesh</dc:creator>
		<pubDate>Tue, 06 Apr 2010 06:15:44 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/08/13/validating-flex-forms-using-the-validator-classes/#comment-7434</guid>
		<description>Hi,
 when i downloaded this source and tried. it showing following error.  Error #1009: Cannot access a property or method of a null object reference.
I dont know what mistake done. pls Help.Thanks in advance.</description>
		<content:encoded><![CDATA[<p>Hi,<br />
 when i downloaded this source and tried. it showing following error.  Error #1009: Cannot access a property or method of a null object reference.<br />
I dont know what mistake done. pls Help.Thanks in advance.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter deHaan</title>
		<link>http://blog.flexexamples.com/2007/08/13/validating-flex-forms-using-the-validator-classes/comment-page-1/#comment-7288</link>
		<dc:creator>Peter deHaan</dc:creator>
		<pubDate>Wed, 17 Mar 2010 15:45:19 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/08/13/validating-flex-forms-using-the-validator-classes/#comment-7288</guid>
		<description>@Jon,

Try explicitly clearing the &lt;code&gt;errorString&lt;/code&gt; properties for each control also:
&lt;pre lang=&quot;actionscript3&quot;&gt;
private function resetForm(evt:MouseEvent):void {
    shippingName.text = &quot;&quot;;
    shippingAddress1.text = &quot;&quot;;
    shippingAddress2.text = &quot;&quot;;
    shippingCity.text = &quot;&quot;;
    shippingState.selectedIndex = -1;
    shippingZipCode.text = &quot;&quot;;
    
    shippingName.errorString = &quot;&quot;;
    shippingAddress1.errorString = &quot;&quot;;
    shippingAddress2.errorString = &quot;&quot;;
    shippingCity.errorString = &quot;&quot;;
    shippingState.errorString = &quot;&quot;;
    shippingZipCode.errorString = &quot;&quot;;
}
&lt;/pre&gt;

Peter</description>
		<content:encoded><![CDATA[<p>@Jon,</p>
<p>Try explicitly clearing the <code>errorString</code> properties for each control also:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> resetForm<span style="color: #000000;">&#40;</span>evt<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">MouseEvent</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
    shippingName<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">text</span> = <span style="color: #990000;">&quot;&quot;</span><span style="color: #000066; font-weight: bold;">;</span>
    shippingAddress1<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">text</span> = <span style="color: #990000;">&quot;&quot;</span><span style="color: #000066; font-weight: bold;">;</span>
    shippingAddress2<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">text</span> = <span style="color: #990000;">&quot;&quot;</span><span style="color: #000066; font-weight: bold;">;</span>
    shippingCity<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">text</span> = <span style="color: #990000;">&quot;&quot;</span><span style="color: #000066; font-weight: bold;">;</span>
    shippingState<span style="color: #000066; font-weight: bold;">.</span>selectedIndex = <span style="color: #000066; font-weight: bold;">-</span><span style="color: #000000; font-weight:bold;">1</span><span style="color: #000066; font-weight: bold;">;</span>
    shippingZipCode<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">text</span> = <span style="color: #990000;">&quot;&quot;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
    shippingName<span style="color: #000066; font-weight: bold;">.</span>errorString = <span style="color: #990000;">&quot;&quot;</span><span style="color: #000066; font-weight: bold;">;</span>
    shippingAddress1<span style="color: #000066; font-weight: bold;">.</span>errorString = <span style="color: #990000;">&quot;&quot;</span><span style="color: #000066; font-weight: bold;">;</span>
    shippingAddress2<span style="color: #000066; font-weight: bold;">.</span>errorString = <span style="color: #990000;">&quot;&quot;</span><span style="color: #000066; font-weight: bold;">;</span>
    shippingCity<span style="color: #000066; font-weight: bold;">.</span>errorString = <span style="color: #990000;">&quot;&quot;</span><span style="color: #000066; font-weight: bold;">;</span>
    shippingState<span style="color: #000066; font-weight: bold;">.</span>errorString = <span style="color: #990000;">&quot;&quot;</span><span style="color: #000066; font-weight: bold;">;</span>
    shippingZipCode<span style="color: #000066; font-weight: bold;">.</span>errorString = <span style="color: #990000;">&quot;&quot;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>Peter</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon</title>
		<link>http://blog.flexexamples.com/2007/08/13/validating-flex-forms-using-the-validator-classes/comment-page-1/#comment-7282</link>
		<dc:creator>Jon</dc:creator>
		<pubDate>Wed, 17 Mar 2010 14:30:09 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/08/13/validating-flex-forms-using-the-validator-classes/#comment-7282</guid>
		<description>Why does resetting the form still leave all the inputs as invalid (i.e. red border) ? How do you reset the form completely, so someone can start from scratch?</description>
		<content:encoded><![CDATA[<p>Why does resetting the form still leave all the inputs as invalid (i.e. red border) ? How do you reset the form completely, so someone can start from scratch?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marc de Kwant</title>
		<link>http://blog.flexexamples.com/2007/08/13/validating-flex-forms-using-the-validator-classes/comment-page-1/#comment-6887</link>
		<dc:creator>Marc de Kwant</dc:creator>
		<pubDate>Sat, 30 Jan 2010 09:22:29 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/08/13/validating-flex-forms-using-the-validator-classes/#comment-6887</guid>
		<description>instead of using an init function to push all validators into an array, I would do this:
&lt;pre lang=&quot;mxml&quot;&gt;
&lt;mx:ArrayCollection&gt;
   &lt;mx:ZipCodeValidator id=&quot;shippingZipCode_zipCodeValidator&quot;
        source=&quot;{shippingZipCode}&quot;
        property=&quot;text&quot;
        requiredFieldError=&quot;Please enter a zip code in ZIP+4 format.&quot;
        domain=&quot;{ZipCodeValidatorDomainType.US_ONLY}&quot;  /&gt;
 
    &lt;mx:StringValidator id=&quot;shippingZipCode_stringValidator&quot;
        source=&quot;{shippingZipCode}&quot;
        property=&quot;text&quot;
         tooShortError=&quot;Please enter a zip code in ZIP+4 format.&quot;
        minLength=&quot;10&quot; maxLength=&quot;10&quot; /&gt;
&lt;/mx:ArrayCollection&gt;
&lt;/pre&gt;

Kind regards,

&lt;a href=&quot;http://www.linkedin.com/in/marcdekwant&quot; rel=&quot;nofollow&quot;&gt;Marc&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>instead of using an init function to push all validators into an array, I would do this:</p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:ArrayCollection</span><span style="color: #7400FF;">&gt;</span></span>
   <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:ZipCodeValidator</span> id=<span style="color: #ff0000;">&quot;shippingZipCode_zipCodeValidator&quot;</span></span>
<span style="color: #000000;">        source=<span style="color: #ff0000;">&quot;{shippingZipCode}&quot;</span></span>
<span style="color: #000000;">        property=<span style="color: #ff0000;">&quot;text&quot;</span></span>
<span style="color: #000000;">        requiredFieldError=<span style="color: #ff0000;">&quot;Please enter a zip code in ZIP+4 format.&quot;</span></span>
<span style="color: #000000;">        domain=<span style="color: #ff0000;">&quot;{ZipCodeValidatorDomainType.US_ONLY}&quot;</span>  <span style="color: #7400FF;">/&gt;</span></span>
 
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:StringValidator</span> id=<span style="color: #ff0000;">&quot;shippingZipCode_stringValidator&quot;</span></span>
<span style="color: #000000;">        source=<span style="color: #ff0000;">&quot;{shippingZipCode}&quot;</span></span>
<span style="color: #000000;">        property=<span style="color: #ff0000;">&quot;text&quot;</span></span>
<span style="color: #000000;">         tooShortError=<span style="color: #ff0000;">&quot;Please enter a zip code in ZIP+4 format.&quot;</span></span>
<span style="color: #000000;">        minLength=<span style="color: #ff0000;">&quot;10&quot;</span> maxLength=<span style="color: #ff0000;">&quot;10&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:ArrayCollection</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p>Kind regards,</p>
<p><a href="http://www.linkedin.com/in/marcdekwant" rel="nofollow">Marc</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim</title>
		<link>http://blog.flexexamples.com/2007/08/13/validating-flex-forms-using-the-validator-classes/comment-page-1/#comment-6615</link>
		<dc:creator>Tim</dc:creator>
		<pubDate>Wed, 16 Dec 2009 02:13:56 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/08/13/validating-flex-forms-using-the-validator-classes/#comment-6615</guid>
		<description>Anybody who  can help me?
I  want to   validate  the password ,which the confirm password is right for the password ?</description>
		<content:encoded><![CDATA[<p>Anybody who  can help me?<br />
I  want to   validate  the password ,which the confirm password is right for the password ?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

