Hey
function onlyDouble(evt) {
var val1;
if (!(evt.keyCode == 46 || (evt.keyCode >= 48 && evt.keyCode <= 57)))
return false;
var parts = evt.srcElement.value.split('.');
if (parts.length > 2)
return false;
if (evt.keyCode == 46)
return (parts.length == 1);
if (evt.keyCode != 46) {
var currVal = String.fromCharCode(evt.keyCode);
val1 = parseFloat(String(parts[0]) + String(currVal));
if(parts.length==2)
val1 = parseFloat(String(parts[0])+ "." + String(currVal));
}
if (val1 > 99.99)
return false;
if (parts.length == 2 && parts[1].length >= 2) return false;
}
//calling on page load
txtPer.Attributes["onkeypress"]="return onlyDouble(event)";