I have some client-side validation against a text box, which only allows numbers up to two decimal places with no other input.
This script was a basis for entering n
You could use a javascript function instead of regex
function IsValid(value) {
var split = value.split('.');
if (split.length != 2) {
return false;
}
else if (split[1].length > 2 || !Number(split[1])) {
return false;
}
else if (!(split[0] == '' || split[0] == '0')) {
return false;
}
return true;
}