B
Bunyip Bluegum
I have a text field in a form which I need to check to see that only a
4-digit integer has been entered. The field has MAXLENGTH=4 and I'm
using this to check for length:
function checkpostcode(form) {
var min=4;
if (form.postcode.value.length < min) {
alert("Please enter a 4-digit postcode");
return false;
}
else return true;
}
That works fine but how can I extend that to check that the input
consists only of four digits. Any help would be much appreciated.
Bunyip
4-digit integer has been entered. The field has MAXLENGTH=4 and I'm
using this to check for length:
function checkpostcode(form) {
var min=4;
if (form.postcode.value.length < min) {
alert("Please enter a 4-digit postcode");
return false;
}
else return true;
}
That works fine but how can I extend that to check that the input
consists only of four digits. Any help would be much appreciated.
Bunyip