Activate server event with javascript

G

Guest

Hi

I have the following scenario: one needs to confirm his password to authorize some operation. In the page, there's a brief of the operation, one asp:textbox and three asp:imagebutton (authorize, cancel operation and close window). The problem is that the enter key, when pressed on the textbox, caused a postback, and it would be annoying to some of our clients. Then, I inserted some javascript to ignore the pressing of the enter key, and it works fine, but now they are complaining that they have or to click the button or to press tab and then enter
So, my question is: is there any way of binding the press of the enter key on the textbox to a specific event (in this case, the authorize button)?

Thanks in advance for any help

Marcelo
 
C

Chris Jackson

Well, you can individually trap the onKeyDown event in each of the text
boxes, and then selectively take action (form.submit()) or do nothing
depending on what text box you are sitting in at the time.
 

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

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top