473,322 Members | 1,409 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,322 software developers and data experts.

Enter Key trapping in aspx with ImageButton

Hi Experts

I have an aspx page in which I am providing a search facility apart from
other matters. I have placed an image button. I have several dropdown lists
and textboxes in the page to provide the search criteria. I want the
imagebutton click to be fired when the user clicks the "Enter" key from
anywhere in the page, even without clicking on any of the controls.

Is there any way to achive this??

Thanks in advance

Regards
Ganesh
Jul 21 '05 #1
1 3630
Hi Ganesh,

This won't take you long at all. In your <body> tag put:

onkeypress="CheckSubmit();"

Then create your CheckSubmit() javascript function:

function CheckSubmit() {
if (event.keyCode == 13) { //Did they hit enter?
Form1.submit();
}
}

That's it. Now your form will submit when the user hits enter. Good luck!
Ken.

--
Ken Dopierala Jr.
For great ASP.Net web hosting try:
http://www.webhost4life.com/default.asp?refid=Spinlight

"Ganesh" <Ga****@discussions.microsoft.com> wrote in message
news:1F**********************************@microsof t.com...
Hi Experts

I have an aspx page in which I am providing a search facility apart from
other matters. I have placed an image button. I have several dropdown lists and textboxes in the page to provide the search criteria. I want the
imagebutton click to be fired when the user clicks the "Enter" key from
anywhere in the page, even without clicking on any of the controls.

Is there any way to achive this??

Thanks in advance

Regards
Ganesh

Jul 21 '05 #2

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

Similar topics

0
by: Jim Mitchell | last post by:
I have the code snippet below. I fill a table of imagebuttons and would like to know which one was clicked to trigger the post back. Unfortunately, the Command event does not fire unless I load...
3
by: Dave Veeneman | last post by:
Is there a simple way to prevent the system from beeping when I hit the Enter key in a single-line text box? I'm trapping the KeyDown event to intercept the key press and advance the focus to...
1
by: Randy | last post by:
Hello All, I'm trying to trap the enter key in my dataGrid using the event... aColumnTextColumn.TextBox.KeyPress += new KeyPressEventHandler(DateKeyPress); The event fires when there is a key...
5
by: Eric | last post by:
Hi All, I'm very experienced in traditional ASP and am new to (am learning) ASP.NET. FYI: I am initially learning ASP.NET with VB.NET to ease the transition for me. I have encountered what I...
7
by: Grant Merwitz | last post by:
Hi I am trying to get the enter key to submit my login form The login form is currently in a control on the page and uses an asp:imagebutton as it's login button. If a user presses enter...
10
by: Perry van Kuppeveld | last post by:
Hi, I have a problem with formatting a table including text fields wich can contain up to 255 chars. I need a table with 3 columns: - First column 50 % over the with a rowspan of the total...
11
by: Joe | last post by:
Hello All, I have an ASP.NET page with one Textbox (SearchTextBox) and one ImageButton (SearchButton) server controls. The user can type search text in SearchTextBox and click SearchButton and...
1
by: Ganesh | last post by:
Hi Experts I have an aspx page in which I am providing a search facility apart from other matters. I have placed an image button. I have several dropdown lists and textboxes in the page to...
0
by: Tom Edelbrok | last post by:
I'm using VS 2005 to develop an intranet asp.net web application and I get a weird situation. If I start out with any ASPX page that contains an ImageButton control followed by a TextBox control,...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.