call buttons onclick handler

J

jan.hancic

Hi,

I have searched everywhere to find this but without luck. Maybe I just
don't know how to search...

Anways I have a form. On this form there are multiple submit buttons.
This is a ASP.NET (2.0) form.
Now I have a textbox. And I would like that when somebody is typing
text into that textbox and then hits enter that a submit button of my
choice would fire (and couse a postback).

I have this code that works in Firefox but does not in IE (this is in
my onkeydown of the textbox):

if(event.keyCode == 13){document.getElementById('btnSearch').click();}

So how would I moddify this to work in IE or is there a better way?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top