numeric validation on javascript in webform
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;
}
///function
function SaveProductDeal(dealId,prodId,CaTid,Price,btnAdd,btnUpd)
{
if (IsNumeric(document.getElementById(Price).value) == false)
{
alert("Please remove all non-Numeric values from Price");
return false;
}
else
{
///function
return false;
}
}
Comments
Post a Comment
Thank you for your Comment