How do I get an input alert message to work only when imputing alphabets, not for numbers? Without letting any text tipped in.
When imputing numbers there should be no alerts, but when imputing alphabets you get an alert. I accept a JavaScript tagged solution too, but if there is an **inline solution** then that is preferred.

The problem with this function is that it lets the text you type in the box if you are fast tipper as I am. It should be **without letting any text tipped in**.

**JavaScript:**

```
<script language="JavaScript">
function checkInp()
{
    var x = document.forms["isnform04"]["areinp"].value;
    var regex = /^[0-9]+$/;
    if (!x.match(regex))
    {
        alert("no text here, input numbers only");
        return false;
    }
}
</script>

```

**HTML:**

```
<input type="text" name="areinp" size="30" value="" onChange="areCon()" onkeyup="return checkInp();">

```

**No query solution plz.**

**UPDATE:** I also used this one:

```
<input type="text" name="areinp" size="30" value="" onChange="areCon()" onkeyup="if (this.value=this.value.replace(/[^\d]/,'')) alert('no text here, input numbers only');">

```