473,395 Members | 1,915 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Activate server event with javascript

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
Nov 18 '05 #1
1 2797
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.

--
Chris Jackson
Software Engineer
Microsoft MVP - Windows Client
Windows XP Associate Expert
--
More people read the newsgroups than read my email.
Reply to the newsgroup for a faster response.
(Control-G using Outlook Express)
--

"marcelo" <an*******@discussions.microsoft.com> wrote in message
news:6F**********************************@microsof t.com...
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

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Michel | last post by:
I like to show a inbetween selfmade menu when rightclicking the page. So on the first line I want to add "Default right-click menu". So first I need to capture it, then I need to stop the...
2
by: Randy Harris | last post by:
I'm working with Access 2K and seem to be getting some behavior that contradicts the documentation. First, the help says: "Note The Activate event doesn't occur when a form receives focus back...
1
by: June Homer | last post by:
I have a form which has its activate event set to maximise the form. This used to work but no long does. I have put a breakpoint in the Activate event and it is never trapped. The form is opened...
9
by: MLH | last post by:
Say I open a form (MyForm) in design view, then I close it and dbl-click it in the database window to open it. Shouldn't the Activate event occur in all such situations? What might the case(s) be...
3
by: active | last post by:
I remember when I checked NewGroups for comments about the VB6 Activate event and found that many thought it was not a reliable way to keep track of which form has focus. There was enough bad press...
2
by: dominic.martin | last post by:
Hi, I'm no javascript programmer but I found a really good piece of javascript at http://www.isdntek.com/tagbot/zipzoom.htm that magnifies areas of an image. It's just what I want but their...
6
by: den 2005 | last post by:
Hi everybody, Question 1: How do you set the values from server-side to a client-side control or how do you execute a javascript function without a button click event? Question 2: How do you...
4
by: Ed | last post by:
I'm writing a VBA macro in Word 2003 that finds and manipulates a web page (Win XP, IE6 sp2). I am having trouble with a checkbox. I can find the checkbox and make it checked, but I can't figure...
17
by: happyse27 | last post by:
Hi All, The html page(see item a below) is calling javascript(item b below), but cant work as the page show blank. Not sure if the method of calling is wrong(in terms of default directory) or...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.