Hi,
I am using following function to check for my input
my input is like 0.00 i dont want to allow any specialcharacte rs. But it is perfectly validating the special symbols and characters.the problem is though I enter something like 45.00 it is giving message.Can anybody help me please its very urgent.
I am using following function to check for my input
my input is like 0.00 i dont want to allow any specialcharacte rs. But it is perfectly validating the special symbols and characters.the problem is though I enter something like 45.00 it is giving message.Can anybody help me please its very urgent.
Code:
function check_basic(){
var value = document.getElementById('curr_basic').value;
var elem = document.getElementById('curr_basic');
var numexp = new RegExp('^[0-9]*\\.?[0-9]*$');
if(value!="")
{
if( elem.value.match(numexp))
{
return true;
}
else
{
alert("Enter Numeric values only");
elem.focus();
return false;
}
}
}
Comment