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

Default button when hit Enter

Hi all,

I have a number of imagebuttons on a page and when the user enters data into
a text field I would like for the page to submit. How would I do that?

Currently, if the user hits Enter, it just posts to the server and returns
to the same page.

Thanks
Harry
Nov 18 '05 #1
3 1088
That's where it's set to POST to then..... did you specify a different page
?

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
"Harry" <NO*****************@hotmail.com> wrote in message
news:%2******************@tk2msftngp13.phx.gbl...
Hi all,

I have a number of imagebuttons on a page and when the user enters data into a text field I would like for the page to submit. How would I do that?

Currently, if the user hits Enter, it just posts to the server and returns
to the same page.

Thanks
Harry

Nov 18 '05 #2
You can intercept the client side enter keypress event of the text box and
then click do what you want using javascript code.
Here's a good example:
http://www.kamp-hansen.dk/pages/show...d=21&menuid=18

You could also try using this free control.
http://www.metabuilders.com/tools/DefaultButtons.aspx

And here's a good article on the subject:
http://www.allasp.net/enterkey.aspx

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com

"Harry" <NO*****************@hotmail.com> wrote in message
news:%2******************@tk2msftngp13.phx.gbl...
Hi all,

I have a number of imagebuttons on a page and when the user enters data into a text field I would like for the page to submit. How would I do that?

Currently, if the user hits Enter, it just posts to the server and returns
to the same page.

Thanks
Harry

Nov 18 '05 #3
Thanks Steve,
Page.RegisterHiddenField("__EVENTTARGET", btnSearch.ClientID) did the trick.

"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
You can intercept the client side enter keypress event of the text box and
then click do what you want using javascript code.
Here's a good example:
http://www.kamp-hansen.dk/pages/show...d=21&menuid=18

You could also try using this free control.
http://www.metabuilders.com/tools/DefaultButtons.aspx

And here's a good article on the subject:
http://www.allasp.net/enterkey.aspx

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com

"Harry" <NO*****************@hotmail.com> wrote in message
news:%2******************@tk2msftngp13.phx.gbl...
Hi all,

I have a number of imagebuttons on a page and when the user enters data

into
a text field I would like for the page to submit. How would I do that?

Currently, if the user hits Enter, it just posts to the server and returns to the same page.

Thanks
Harry


Nov 18 '05 #4

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

Similar topics

1
by: Billy Jacobs | last post by:
Is there a way to make a button on a web form the default button so that when the user hits the enter button the code for that button executes? I have a web page Login.aspx where I have only 1...
2
by: JP | last post by:
Hi, It's a login screen, so users enter their ID/Password and hit <ENTER> instead of clicking on Login button. But when they hit <ENTER> an Image Button gets clicked. I want to make my Login...
2
by: Bratislav Jevtic | last post by:
hi, how to make some push button default on the form? for instance, I've got 2 buttons (Submit, Cancel). submit is on the left, cancel on the right side. on enter key pressed, cancel button is...
4
by: RA | last post by:
Hi I have asp.net web app. When a user clicks the enter key when he is viewing the aspx web form, it jumps to the starting web form. How can I handle the user hitting the enter key and to...
2
by: makthar | last post by:
Thanks for taking the time to read this note Can anyone explain what went wrong and any ideas how to fix it I have a search page With three buttons few drop downs and a textbox. The search...
2
by: Flip | last post by:
On my current form, when I hit the enter key in a texbox, the form appears to resubmit itself, but it's not actually doing a submit (or so I think?). I would like to have the enter button fire the...
2
by: jonefer | last post by:
This is quite serious - for a beginner... No property setting for a default button? I just want a button on a search page to automatically be pressed when I hit the return/enter key. Somehow I...
1
by: andyrich_1 | last post by:
I have a simple form that has two submit buttons on it. The problem I have is that I want one button to be the default button when the user is filling out one section of the form and another button...
15
by: simonoficina | last post by:
Hello all! I am a vb.net beginner in Spain. When I use VB6 ,the button object has a property called "default" that can set this button like press "ENTER" key. But in the VB.net I can't find this...
0
by: thersitz | last post by:
Hi, Using aspnet3.5,VStudio 2008, VB 1.) I have a set of pages, with a search text box button within a userControl that searches across our websites and is registered in a masterpage. 2)...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...

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.