[Javascript] capturing onkeydown in Mozilla

Flavio Gomes flavio at economisa.com.br
Mon May 17 08:44:43 CDT 2004


Peter-Paul Koch wrote:

>
>
>>     As the subject suggests, I'm trying to catch onkeydown in a text
>> input field and call a function as a result.  If I do this,
>>
>> <input type="text" name="countryList_searchBox"
>> id="countryList_searchBox" onkeydown="alert('gabooga')" >
>>
>> I get the expected alert... BUT when I change the onkeydown event
>> handler to
>>
>> onkeydown="ELB_CheckFilter"
>
>
> onkeydown="ELB_CheckFilter()"

onkeydown="ELB_CheckFilter(event)" // ^^

>
>> which points to this function
>>
>> function ELB_CheckFilter(evt) {
>>     alert("Checking event");
>>     }
>>
>> I never get an alert!  What am I doing wrong?
>
>
> You use inline event handlers, so you should actually call the 
> function (ie. add brackets), instead of just assigning it to the event 
> handler.
>

o.o

-- 
Flavio Gomes
flavio at economisa.com.br




More information about the Javascript mailing list