Test for numeric values vs integers

Hello guys,
i have the following script below, that tests for an integer.

How do i enable it to test for numeric, ie when u have a period.

thanks


function checkNum(x)
{
if (!(/^\\d+$/.test(x.value)))
{
alert("Only Numeric Values Allowed");
x.focus();
return false;
}
return true;
}

function checkNum(x){
	if(parseFloat(x.value)!= x.value){
		alert('numbers only');
		x.focus();
		return false;
	}
	return true;
}

thanks a lot, it worked.

:slight_smile: