I'm trying to use the addevent() method to add an event to a form field.

This is the form field I want to apply my event to:
Code HTML4Strict:
<input type="text" name="site_search" id="site_search" value="">

This is the javascript what applies the event:

Code JavaScript:
container = document.getElementById('site_search');

This is just a couple of lines of my code, I've simplified it slightly to get to the point. It kicks out an error on this line:

Code JavaScript:
elm.addEventListener(evType, fn, useCapture);

of the addevent() function.

Any ideas of how to solve this please?

Ta very much