Question: I am trying to input a telephone number in an input box like this (ex. 111-222-3333)

so I use this code:

```
<script type="text/javascript">
    function validate(evt) {
      var theEvent = evt || window.event;
      var key = theEvent.keyCode || theEvent.which;
      key = String.fromCharCode( key );
      var regex = /[0-9]|\-/;
      if( !regex.test(key) ) {
        theEvent.returnValue = false;
        if(theEvent.preventDefault) theEvent.preventDefault();
     }
    }
</script>

```

I can now only input telephone number using integer(0-9) and '-' but the problem is user can also type another hyphen(‐) after a hyphen(‐).
Or user can type numbers not in a telephone format

Please help me, i really need this one..thanks:)

Answer: 
You could use an alternate framework such as <http://alexgorbatchev.com/SyntaxHighlighter/>

Or take a look here and find something that suites.
<http://www.1stwebdesigner.com/css/16-free-javascript-code-syntax-highlighters-for-better-programming/>
The basic steps would be:

1. Take the HTML inside the element.
2. Split by newline characters (`\n`).
3. For each string, add a number and a dot in front of it.
4. Combine the strings again with newline characters.
5. Set the string as the HTML of the element.

However, this would mess up the syntax highlighting of the syntax highlighter because it most likely won't recognize that the code has line numbers in front. So the syntax highlighter needs to provide the functionality of line numbers for you.