473,395 Members | 1,442 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.

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 3634
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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...

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.