2 * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/)
3 * Copyright (C) 2002-2009 The Nucleus Group
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
9 * (see nucleus/documentation/index.html#license for more info)
11 * script the check (on the clientside) if a entered value
12 * is a valid number and remove the invalid chars
15 * $NucleusJP: numbercheck.js,v 1.3 2006/07/12 07:11:47 kimitake Exp $
18 function checkNumeric(f)
22 for (i = 0; i < f.value.length; i++) {
23 c = f.value.substring(i,i+1);
24 if (isInteger(c) || ((c == '.')&&(dot == false)) || ((i == 0)&&(c == '-'))) {
34 function isInteger(value)
36 return (parseInt(value) == value);