[Flashcoders] Verifying Numerical Input

2008-07-16 Thread ITSCO
Hello Everybody, Before I try to maybe re-invent the Wheel, and write my own code. I was wondering whether anyone has a sample Actionscript 3.0 code for verifying the input to a text field is a Number. Generally, the isNaN() is ok. But when one input a number with the Thousand

Re: [Flashcoders] Verifying Numerical Input

2008-07-16 Thread Juan Pablo Califano
A quick way to do it I can think of off the top of my head is making a copy of the user's input, strip the thousands separator, cast to Number and pass the result to some formatNumber function (like the one in the ActionScript CookBook lib). Then, just compare that with the original input; if

Re: [Flashcoders] Verifying Numerical Input

2008-07-16 Thread Ashim D'Silva
I'd say if it doesn't influence your system too much, restrict what's put in the text field (txtField.restrict) to just numbers. That way, it saves you trouble, and it shows the user what you're expecting instead of doing 'magic' in the background. 2008/7/17 Juan Pablo Califano [EMAIL PROTECTED]: