|
|
 |
Re: FN-FORUM: Currency Validation in Javascript
date posted 1st June 2007 17:46
On Thursday 31 May 2007 8:01 pm, James Herrington wrote:
> >Am I right these snippets are looking for either
> >"abc" or "abc.de" (where "abc" is one or more digits)?
>
> Yer thats right. How would you do it with just plain javascript?
First check if it's numeric; if not then check the third from last=20
character is a "." and that the remaining bits are numeric.
But it turns out that Javascript doesn't have a built-in isnumeric().
Evil sucky language.
And a quick Google throws up lots of evil sucky broken implementations
of IsNumeric().
> I was thinking about looping through each character but is it really an=
y
> more efficient? Also the .indexOf() function could be used to find the
Whatever happens you're going to be looping through the string one=20
way or another.
--=20
5: When responding to a post, delete all information that is not
strictly necessary. This includes the freelancers tag line and .sig
files. Delete anything you're not specifically responding to.
|
 |
|