I've managed to validate my field so it is always four digits, but i need to validate so that it is always a number. I tried adding this block of code but it doesn't work properly.

```
if (!(document.ExamEntry.cand.value.match(numbers))) {
    msg += "Only use numeric characters \n";
    document.ExamEntry.cand.focus();
    document.getElementById('cand').style.color = "red";
    result = false;
}  

```

This will allow four digit combinations like 9a9a or !2#3 etc.
I added the "numbers" variable like this;

```
var numbers = /[0-9]/;

```

What is a better way of doing this validation?