<?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 integers using the NumberValidator class</title>
	<atom:link href="http://blog.flexexamples.com/2008/08/30/validating-integers-using-the-numbervalidator-class/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.flexexamples.com/2008/08/30/validating-integers-using-the-numbervalidator-class/</link>
	<description>Just a bunch of Adobe Flex Examples</description>
	<lastBuildDate>Sat, 11 Feb 2012 11:51:51 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Peter deHaan</title>
		<link>http://blog.flexexamples.com/2008/08/30/validating-integers-using-the-numbervalidator-class/comment-page-1/#comment-6915</link>
		<dc:creator>Peter deHaan</dc:creator>
		<pubDate>Wed, 03 Feb 2010 16:19:37 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/08/30/validating-integers-using-the-numbervalidator-class/#comment-6915</guid>
		<description>@Sameera Sandaruwan,

Try setting the &lt;code&gt;errorColor&lt;/code&gt; style; &lt;a href=&quot;http://blog.flexexamples.com/2007/09/01/customizing-a-flex-textinput-controls-error-color/&quot; rel=&quot;nofollow&quot;&gt;&quot;Customizing a Flex TextInput control&#039;s error color&quot;&lt;/a&gt;.

Peter</description>
		<content:encoded><![CDATA[<p>@Sameera Sandaruwan,</p>
<p>Try setting the <code>errorColor</code> style; <a href="http://blog.flexexamples.com/2007/09/01/customizing-a-flex-textinput-controls-error-color/" rel="nofollow">&#8220;Customizing a Flex TextInput control&#8217;s error color&#8221;</a>.</p>
<p>Peter</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sameera Sandaruwan</title>
		<link>http://blog.flexexamples.com/2008/08/30/validating-integers-using-the-numbervalidator-class/comment-page-1/#comment-6914</link>
		<dc:creator>Sameera Sandaruwan</dc:creator>
		<pubDate>Wed, 03 Feb 2010 11:10:22 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/08/30/validating-integers-using-the-numbervalidator-class/#comment-6914</guid>
		<description>Do you anyone can help me to change, theme color when validations active(red color), i need to change some other, but still working on.</description>
		<content:encoded><![CDATA[<p>Do you anyone can help me to change, theme color when validations active(red color), i need to change some other, but still working on.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Usman Ajmal</title>
		<link>http://blog.flexexamples.com/2008/08/30/validating-integers-using-the-numbervalidator-class/comment-page-1/#comment-6679</link>
		<dc:creator>Usman Ajmal</dc:creator>
		<pubDate>Sat, 26 Dec 2009 17:54:53 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/08/30/validating-integers-using-the-numbervalidator-class/#comment-6679</guid>
		<description>Thanks a lot Peter. I already managed to develop what you just suggested. However, I did not know about   mx.events.ValidationResultEvent. Thanks for letting me know about it and answering me. :)</description>
		<content:encoded><![CDATA[<p>Thanks a lot Peter. I already managed to develop what you just suggested. However, I did not know about   mx.events.ValidationResultEvent. Thanks for letting me know about it and answering me. :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter deHaan</title>
		<link>http://blog.flexexamples.com/2008/08/30/validating-integers-using-the-numbervalidator-class/comment-page-1/#comment-6676</link>
		<dc:creator>Peter deHaan</dc:creator>
		<pubDate>Sat, 26 Dec 2009 16:27:49 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/08/30/validating-integers-using-the-numbervalidator-class/#comment-6676</guid>
		<description>@Usman Ajmal,

Sure. But I&#039;d probably just check that the &lt;code&gt;selectedIndex&lt;/code&gt; property isn&#039;t -1, as seen in the following example:
&lt;pre lang=&quot;mxml&quot;&gt;
&lt;?xml version=&quot;1.0&quot;?&gt;
&lt;mx:Application xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot;&gt;
    
    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.controls.Alert;
            import mx.events.ValidationResultEvent;
            
            private function validateForm():void {
                var result:ValidationResultEvent = numVal.validate();

                switch (result.type) {
                    case ValidationResultEvent.INVALID:
                        Alert.show(result.message, &quot;Error!&quot;);
                        break;
                    case ValidationResultEvent.VALID:
                        Alert.show(&quot;Thanks!&quot;);
                        break;
                }
            }
        ]]&gt;
    &lt;/mx:Script&gt;
    
    &lt;mx:NumberValidator id=&quot;numVal&quot; 
            source=&quot;{lst}&quot; 
            property=&quot;selectedIndex&quot;
            minValue=&quot;0&quot;
            lowerThanMinError=&quot;Please select an item from the list.&quot; /&gt;
    
    &lt;mx:Form defaultButton=&quot;{btn}&quot;&gt;
        &lt;mx:FormItem label=&quot;Products:&quot;&gt;
            &lt;mx:List id=&quot;lst&quot; 
                    allowMultipleSelection=&quot;true&quot;
                    width=&quot;100&quot;&gt;
                &lt;mx:dataProvider&gt;
                    &lt;mx:ArrayCollection source=&quot;[one,two,three,four,five,six,seven,eight,nine,ten]&quot; /&gt;
                &lt;/mx:dataProvider&gt;
            &lt;/mx:List&gt;
        &lt;/mx:FormItem&gt;
        &lt;mx:FormItem&gt;
            &lt;mx:Button id=&quot;btn&quot;
                    label=&quot;Submit&quot;
                    click=&quot;validateForm();&quot; /&gt;
        &lt;/mx:FormItem&gt;
    &lt;/mx:Form&gt;
    
&lt;/mx:Application&gt;
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>@Usman Ajmal,</p>
<p>Sure. But I&#8217;d probably just check that the <code>selectedIndex</code> property isn&#8217;t -1, as seen in the following example:</p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span>?<span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Application</span> xmlns:mx=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #339933;">&lt;mx:Script&gt;</span>
<span style="color: #339933;">        &lt;![CDATA[</span>
<span style="color: #339933;">            import mx.controls.Alert;</span>
<span style="color: #339933;">            import mx.events.ValidationResultEvent;</span>
&nbsp;
<span style="color: #339933;">            private function validateForm():void {</span>
<span style="color: #339933;">                var result:ValidationResultEvent = numVal.validate();</span>
&nbsp;
<span style="color: #339933;">                switch (result.type) {</span>
<span style="color: #339933;">                    case ValidationResultEvent.INVALID:</span>
<span style="color: #339933;">                        Alert.show(result.message, &quot;Error!&quot;);</span>
<span style="color: #339933;">                        break;</span>
<span style="color: #339933;">                    case ValidationResultEvent.VALID:</span>
<span style="color: #339933;">                        Alert.show(&quot;Thanks!&quot;);</span>
<span style="color: #339933;">                        break;</span>
<span style="color: #339933;">                }</span>
<span style="color: #339933;">            }</span>
<span style="color: #339933;">        ]]&gt;</span>
<span style="color: #339933;">    &lt;/mx:Script&gt;</span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:NumberValidator</span> id=<span style="color: #ff0000;">&quot;numVal&quot;</span> </span>
<span style="color: #000000;">            source=<span style="color: #ff0000;">&quot;{lst}&quot;</span> </span>
<span style="color: #000000;">            property=<span style="color: #ff0000;">&quot;selectedIndex&quot;</span></span>
<span style="color: #000000;">            minValue=<span style="color: #ff0000;">&quot;0&quot;</span></span>
<span style="color: #000000;">            lowerThanMinError=<span style="color: #ff0000;">&quot;Please select an item from the list.&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Form</span> defaultButton=<span style="color: #ff0000;">&quot;{btn}&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:FormItem</span> label=<span style="color: #ff0000;">&quot;Products:&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:List</span> id=<span style="color: #ff0000;">&quot;lst&quot;</span> </span>
<span style="color: #000000;">                    allowMultipleSelection=<span style="color: #ff0000;">&quot;true&quot;</span></span>
<span style="color: #000000;">                    width=<span style="color: #ff0000;">&quot;100&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:dataProvider</span><span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:ArrayCollection</span> source=<span style="color: #ff0000;">&quot;[one,two,three,four,five,six,seven,eight,nine,ten]&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:dataProvider</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:List</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:FormItem</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:FormItem</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Button</span> id=<span style="color: #ff0000;">&quot;btn&quot;</span></span>
<span style="color: #000000;">                    label=<span style="color: #ff0000;">&quot;Submit&quot;</span></span>
<span style="color: #000000;">                    click=<span style="color: #ff0000;">&quot;validateForm();&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:FormItem</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Form</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

]]></content:encoded>
	</item>
	<item>
		<title>By: Usman Ajmal</title>
		<link>http://blog.flexexamples.com/2008/08/30/validating-integers-using-the-numbervalidator-class/comment-page-1/#comment-6674</link>
		<dc:creator>Usman Ajmal</dc:creator>
		<pubDate>Sat, 26 Dec 2009 12:13:03 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/08/30/validating-integers-using-the-numbervalidator-class/#comment-6674</guid>
		<description>Nice Example but can I user NumberValidator to validate if  atleast one item from a list has been selected using, probably, it&#039;s selectedIndices property which is set to NULL at the init() of an application?</description>
		<content:encoded><![CDATA[<p>Nice Example but can I user NumberValidator to validate if  atleast one item from a list has been selected using, probably, it&#8217;s selectedIndices property which is set to NULL at the init() of an application?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sameera Sandaruwan</title>
		<link>http://blog.flexexamples.com/2008/08/30/validating-integers-using-the-numbervalidator-class/comment-page-1/#comment-6440</link>
		<dc:creator>Sameera Sandaruwan</dc:creator>
		<pubDate>Tue, 24 Nov 2009 07:56:20 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/08/30/validating-integers-using-the-numbervalidator-class/#comment-6440</guid>
		<description>&lt;strong&gt;Steps to reproduce:&lt;/strong&gt;
1. TextInput creates dynamically
&lt;pre lang=&quot;actionscript3&quot;&gt;
textInputBox = new MyTextInput;

textInputBox.restrict = &quot;0-9.&quot;;
textInputBox.maxChars = 24;
amountValidator = new NumberValidator();
amountValidator.source = textInputBox;
amountValidator.property = &quot;text&quot;;
amountValidator.allowNegative = false;
amountValidator.domain = &quot;real&quot;;
amountValidator.precision = 4;
amountValidator.required = false;
amountValidator.maxValue = 999999999999.9999;
amountValidator.trigger = textInputBox;
amountValidator.triggerEvent = Event.CHANGE;
amountValidator.addEventListener(ValidationResultEvent.VALID, amountValid);
amountValidator.addEventListener(ValidationResultEvent.INVALID, amountInvalid);

private function amountValid(event:ValidationResultEvent):void
{
    valid = true;
    fieldsValidated = true;
}

private function amountInvalid(event:ValidationResultEvent):void
{
    valid = false;
    fieldsValidated = true;
}
&lt;/pre&gt;

2. As mention in the creation, when we exceed the limit, it shows error my red color border, and the same time if you delete them by DEL key when it come to the given acceptable limit, automatically become to green soon.
3. Leave from the field and change values of another textinput(this is just a textinput, this is a form there are some more form elemets), then come back to value exceeded textfield by SHIFT+TABS and remove the additional entered numbers, when you come to green soon your value is accepted.
4.Now again enter more values and now you are in the warn zone, then leave from the field and do the few changes in other form elements.
5. Then come back to the value exceeded text filed by MOUSE CLICK, and start delete from DEL, even though you removed additional values, still fields shows that you are in warn zone.
 
 Actual Results:
 Even when remove additional numbers,still field is Red
 
 Expected Results:
 if remove additional numbers, field should come its normal status. 

Picture of this issue can be viewed at &lt;a href=&quot;http://bugs.adobe.com/jira/browse/SDK-24372&quot; rel=&quot;nofollow&quot;&gt;View Screen Shot&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p><strong>Steps to reproduce:</strong><br />
1. TextInput creates dynamically</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;">textInputBox = <span style="color: #0033ff; font-weight: bold;">new</span> MyTextInput<span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
textInputBox<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">restrict</span> = <span style="color: #990000;">&quot;0-9.&quot;</span><span style="color: #000066; font-weight: bold;">;</span>
textInputBox<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">maxChars</span> = <span style="color: #000000; font-weight:bold;">24</span><span style="color: #000066; font-weight: bold;">;</span>
amountValidator = <span style="color: #0033ff; font-weight: bold;">new</span> NumberValidator<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
amountValidator<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">source</span> = textInputBox<span style="color: #000066; font-weight: bold;">;</span>
amountValidator<span style="color: #000066; font-weight: bold;">.</span>property = <span style="color: #990000;">&quot;text&quot;</span><span style="color: #000066; font-weight: bold;">;</span>
amountValidator<span style="color: #000066; font-weight: bold;">.</span>allowNegative = <span style="color: #0033ff; font-weight: bold;">false</span><span style="color: #000066; font-weight: bold;">;</span>
amountValidator<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">domain</span> = <span style="color: #990000;">&quot;real&quot;</span><span style="color: #000066; font-weight: bold;">;</span>
amountValidator<span style="color: #000066; font-weight: bold;">.</span>precision = <span style="color: #000000; font-weight:bold;">4</span><span style="color: #000066; font-weight: bold;">;</span>
amountValidator<span style="color: #000066; font-weight: bold;">.</span>required = <span style="color: #0033ff; font-weight: bold;">false</span><span style="color: #000066; font-weight: bold;">;</span>
amountValidator<span style="color: #000066; font-weight: bold;">.</span>maxValue = <span style="color: #000000; font-weight:bold;">999999999999.9999</span><span style="color: #000066; font-weight: bold;">;</span>
amountValidator<span style="color: #000066; font-weight: bold;">.</span>trigger = textInputBox<span style="color: #000066; font-weight: bold;">;</span>
amountValidator<span style="color: #000066; font-weight: bold;">.</span>triggerEvent = <span style="color: #004993;">Event</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">CHANGE</span><span style="color: #000066; font-weight: bold;">;</span>
amountValidator<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span>ValidationResultEvent<span style="color: #000066; font-weight: bold;">.</span>VALID<span style="color: #000066; font-weight: bold;">,</span> amountValid<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
amountValidator<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span>ValidationResultEvent<span style="color: #000066; font-weight: bold;">.</span>INVALID<span style="color: #000066; font-weight: bold;">,</span> amountInvalid<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> amountValid<span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">:</span>ValidationResultEvent<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>
    valid = <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000066; font-weight: bold;">;</span>
    fieldsValidated = <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> amountInvalid<span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">:</span>ValidationResultEvent<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>
    valid = <span style="color: #0033ff; font-weight: bold;">false</span><span style="color: #000066; font-weight: bold;">;</span>
    fieldsValidated = <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>2. As mention in the creation, when we exceed the limit, it shows error my red color border, and the same time if you delete them by DEL key when it come to the given acceptable limit, automatically become to green soon.<br />
3. Leave from the field and change values of another textinput(this is just a textinput, this is a form there are some more form elemets), then come back to value exceeded textfield by SHIFT+TABS and remove the additional entered numbers, when you come to green soon your value is accepted.<br />
4.Now again enter more values and now you are in the warn zone, then leave from the field and do the few changes in other form elements.<br />
5. Then come back to the value exceeded text filed by MOUSE CLICK, and start delete from DEL, even though you removed additional values, still fields shows that you are in warn zone.</p>
<p> Actual Results:<br />
 Even when remove additional numbers,still field is Red</p>
<p> Expected Results:<br />
 if remove additional numbers, field should come its normal status. </p>
<p>Picture of this issue can be viewed at <a href="http://bugs.adobe.com/jira/browse/SDK-24372" rel="nofollow">View Screen Shot</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JabbyPanda</title>
		<link>http://blog.flexexamples.com/2008/08/30/validating-integers-using-the-numbervalidator-class/comment-page-1/#comment-6399</link>
		<dc:creator>JabbyPanda</dc:creator>
		<pubDate>Thu, 19 Nov 2009 11:50:26 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/08/30/validating-integers-using-the-numbervalidator-class/#comment-6399</guid>
		<description>It&#039;s worthy to note that it is more  error-proof to use defined constants in static class NumberValidatorDomainType: NumberValidatorDomainType.INT and NumberValidatorDomainType.REAL instead of hardcoded strings &quot;int&quot; and &quot;real&quot;</description>
		<content:encoded><![CDATA[<p>It&#8217;s worthy to note that it is more  error-proof to use defined constants in static class NumberValidatorDomainType: NumberValidatorDomainType.INT and NumberValidatorDomainType.REAL instead of hardcoded strings &#8220;int&#8221; and &#8220;real&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter deHaan</title>
		<link>http://blog.flexexamples.com/2008/08/30/validating-integers-using-the-numbervalidator-class/comment-page-1/#comment-3768</link>
		<dc:creator>Peter deHaan</dc:creator>
		<pubDate>Mon, 15 Dec 2008 16:33:34 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/08/30/validating-integers-using-the-numbervalidator-class/#comment-3768</guid>
		<description>Elextra,

The &lt;code&gt;restrict&lt;/code&gt; restrict property only accepts &quot;simple&quot; strings, not regular expressions, and it basically matches how the TextField class&#039;s &lt;code&gt;restrict&lt;/code&gt; property works.

http://livedocs.adobe.com/flex/3/langref/mx/controls/TextInput.html#restrict
http://livedocs.adobe.com/flex/3/langref/flash/text/TextField.html#restrict

You could try listening for the &lt;code&gt;change&lt;/code&gt; and/or &lt;code&gt;textInput&lt;/code&gt; events and then calling a custom RegExpValidator: http://livedocs.adobe.com/flex/3/langref/mx/validators/RegExpValidator.html

Peter</description>
		<content:encoded><![CDATA[<p>Elextra,</p>
<p>The <code>restrict</code> restrict property only accepts &#8220;simple&#8221; strings, not regular expressions, and it basically matches how the TextField class&#8217;s <code>restrict</code> property works.</p>
<p><a href="http://livedocs.adobe.com/flex/3/langref/mx/controls/TextInput.html#restrict" rel="nofollow">http://livedocs.adobe.com/flex/3/langref/mx/controls/TextInput.html#restrict</a><br />
<a href="http://livedocs.adobe.com/flex/3/langref/flash/text/TextField.html#restrict" rel="nofollow">http://livedocs.adobe.com/flex/3/langref/flash/text/TextField.html#restrict</a></p>
<p>You could try listening for the <code>change</code> and/or <code>textInput</code> events and then calling a custom RegExpValidator: <a href="http://livedocs.adobe.com/flex/3/langref/mx/validators/RegExpValidator.html" rel="nofollow">http://livedocs.adobe.com/flex/3/langref/mx/validators/RegExpValidator.html</a></p>
<p>Peter</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Elextra</title>
		<link>http://blog.flexexamples.com/2008/08/30/validating-integers-using-the-numbervalidator-class/comment-page-1/#comment-3767</link>
		<dc:creator>Elextra</dc:creator>
		<pubDate>Mon, 15 Dec 2008 11:38:26 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/08/30/validating-integers-using-the-numbervalidator-class/#comment-3767</guid>
		<description>Sorry, code was swollen by the blog parser
&lt;pre class=&quot;code&quot;&gt;
&lt;mx:TextInput id=&quot;someid&quot; restrict=&quot;(^[1-9])+[0-9]+&quot;/&gt;
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Sorry, code was swollen by the blog parser</p>
<pre class="code">
&lt;mx:TextInput id="someid" restrict="(^[1-9])+[0-9]+"/&gt;
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Elextra</title>
		<link>http://blog.flexexamples.com/2008/08/30/validating-integers-using-the-numbervalidator-class/comment-page-1/#comment-3769</link>
		<dc:creator>Elextra</dc:creator>
		<pubDate>Mon, 15 Dec 2008 11:36:26 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/08/30/validating-integers-using-the-numbervalidator-class/#comment-3769</guid>
		<description>Hi guys,

I was wondering if I could use restrict to put in some real regex stuff.
Example: Can I put in a regex of this kind /(^[1-9])+[0-9]+/
Basically, I don&#039;t wanna allow the user to enter 0 as a first digit, but it should be allowed afterward. All data entered should be digits.
123123 is valid
012313 is not valid
323403 is valid

I dont seem to be able to do that with restrict! My code is:
  --&gt; which basically only allows me to enter open parenthesis ....
I am clearly doing something wrong?
Thanks</description>
		<content:encoded><![CDATA[<p>Hi guys,</p>
<p>I was wondering if I could use restrict to put in some real regex stuff.<br />
Example: Can I put in a regex of this kind /(^[1-9])+[0-9]+/<br />
Basically, I don&#8217;t wanna allow the user to enter 0 as a first digit, but it should be allowed afterward. All data entered should be digits.<br />
123123 is valid<br />
012313 is not valid<br />
323403 is valid</p>
<p>I dont seem to be able to do that with restrict! My code is:<br />
  &#8211;&gt; which basically only allows me to enter open parenthesis &#8230;.<br />
I am clearly doing something wrong?<br />
Thanks</p>
]]></content:encoded>
	</item>
</channel>
</rss>

