leoparamundayil
Apr 19th 2007, 11:32 pm
Hai Freinds,
i have a javascript problem... plz try to solve it soon
urgent
its for numeric field validation
function IsNumeric(sText){
var ValidChars = "0123456789,";
var IsNumber=true;
var Char;
for (i = 0; i < sText.length && IsNumber == true; i++){
Char = sText.charAt(i);
if (ValidChars.indexOf(Char) == -1){
IsNumber = false;
}
}
return IsNumber;
}
presently we are using the above javascript.
we allow numbers and commas
now the requirment is -
the format should be 1,234,567 or 123,456 or 12,345,678
only max 8 numbers should be allowed in textbox
but we are setting the size of textbox as 10 to allow 2 commas also...
also we should not allow 2 commas together.
can u find a solution and send it back
i have a javascript problem... plz try to solve it soon
urgent
its for numeric field validation
function IsNumeric(sText){
var ValidChars = "0123456789,";
var IsNumber=true;
var Char;
for (i = 0; i < sText.length && IsNumber == true; i++){
Char = sText.charAt(i);
if (ValidChars.indexOf(Char) == -1){
IsNumber = false;
}
}
return IsNumber;
}
presently we are using the above javascript.
we allow numbers and commas
now the requirment is -
the format should be 1,234,567 or 123,456 or 12,345,678
only max 8 numbers should be allowed in textbox
but we are setting the size of textbox as 10 to allow 2 commas also...
also we should not allow 2 commas together.
can u find a solution and send it back