From a question in this site I found the following code of romaintaz:
<script type="text/javascript">
function testField(field) {
var regExpr = new RegExp("^\d*\.?\d*$");
if (!regExpr.test(field.value)) {
// Case of error
field.value = "";
}
}
</script>
My question now is: How can I make this validator only accept numbers and nothing else? Any integer.