Validation of TextBox Input
I need to validate the input to TextBox. Values allowed are either 0.00 or bteween 0-9. I wrote follwing function:
private bool isNumeric(string val)
{
foreach (char c in val.ToCharArray())
{
if (!Char.IsDigit(c))
{
return false; }
}
return true;
}
but this does not accept 0.00 as numeric value or it does not accept . as numeric value. What is the best solution? I am not well versed with JavaScript.
Tank you
Bharat Gadhia
=============================================
Oh - once in your life you find someone
Who will turn your world around
Bring you up when you're feelin' down
From: Bryan Adams
Heaven
Bharat Gadhia
__________________
Bharat Gadhia
|