Default Button / Press Enter Key in Web Form

Just notified by a new teammate today: There is page maintaining the master record of employees in one of my ASP.NET internal web app, he entered some text in that page and then press [ENTER], nothing happened so he came to me and told me that the search function is not work.

I go to that page and find that the reason of the "failure" is just because the programmer who wrote this page didn't handle the "Enter" key event, so nothing happen by the keyboard but only response from the "click" action. Ahh... What the...


Anyway, I went to Mike's blog immediately as I remembered he blogged about this topic in the past, I added his code by following his code snippet but it didn't work. (FYI: I have only 1 TextBox and 1 Button on that page only)

Finally, I added few lines of JavaScript code in order to catch this action (the keypoint is this line of code: event.returnValue=false;) and then it worked perfectly! Minor issue but "resume" the functionality. :o)

Colt Kwong

Published Saturday, April 09, 2005 12:53 AM by Colt
Filed under:

Comments

# re: Default Button / Press Enter Key in Web Form

Friday, April 08, 2005 12:03 PM by Scott Galloway

# re: Default Button / Press Enter Key in Web Form

yeah, I think I saw Mike's solution at some point, but I was already using Andy's Smiths Default Buttons control.

http://www.metabuilders.com/Tools/DefaultButtons.aspx


To me, the default buttons control is a much better solution because it allows you to define a button for a specific control on the page declaritively.

Friday, April 08, 2005 12:48 PM by Scott

# re: Default Button / Press Enter Key in Web Form

I have a solution [1] that I posted a while back. This solution involves simply adding an invisible HTML textbox to the page.

This works with all validators and so on...

[1] http://www.mattberther.com/2003/06/000125.html

Friday, April 08, 2005 12:48 PM by Matt Berther

# re: Default Button / Press Enter Key in Web Form

The DefaultButtons control found at www.metabuilders.com works quite well and is free.

Friday, April 08, 2005 6:18 PM by Richard P

# re: Default Button / Press Enter Key in Web Form

Yo! Thanks guys! Appreciate the solutions by all of you! :o)

Friday, April 08, 2005 9:34 PM by Colt

# re: Default Button / Press Enter Key in Web Form

Hi, Colt -- the link above is to the trackback page ... I think you want this one:

http://www.mikepope.com/blog/displayblog.aspx?permalink=309

Thanks,

-- Mike

PS I've updated the entry to point back to this. :-)

Monday, April 11, 2005 12:35 PM by mike

# re: Default Button / Press Enter Key in Web Form

HI,

i have one test box and three buttons(apply,refresh,close).Through java script I am validateing that text box like it should not take desimal value,shuld not take alfebets.

Now if i m clecking on mouse to apply button then it is working fine.

but if I am giveing Enter button then it is not going to my function, where I am validating it.

so can you please sugest me some thing.

Thursday, February 28, 2008 9:09 AM by Debasis Mohapatra

# re: Default Button / Press Enter Key in Web Form

pls help me. not working for me. i have used validation control for this. does it make any difference?

Wednesday, June 18, 2008 6:40 AM by PK

# re: Default Button / Press Enter Key in Web Form

Default Button / Press Enter Key in Web Form

Saturday, January 24, 2009 3:10 AM by Dimple

# re: Default Button / Press Enter Key in Web Form

Hi,

I want the software which press auto Ctrl + G then press enter. I can stop it when ever i required. So please help me with the same.

Thanks,

Pankaj

Monday, April 06, 2009 10:58 AM by Pankaj

# re: Default Button / Press Enter Key in Web Form

Even in this digital age where every bit of information is available in digital form. ,

Thursday, October 22, 2009 7:13 PM by Daddy47

# re: Default Button / Press Enter Key in Web Form

Hi guys. Nobody is ever met at the airport when beginning a new adventure. It's just not done. Help me! Please help find sites for: Mephisto sandals discount. I found only this - <a href="www.lgl.lu/.../mephisto-ladina">mephisto ladina</a>. Mephisto, the paradise x waterproof was never very orphaned, popular to regular system controversy through its tourist. Running to his show meine welt, he had costumed it browsing when arthur friedheim was ordering liszt's lucrezia-fantasy, mephisto. Thanks :mad:. Delilah from Verde.

Monday, March 22, 2010 10:48 PM by Delilah

# re: Default Button / Press Enter Key in Web Form

Really cool blog as for me. It would be nice to read more about this theme. Thanx for sharing this data.

Abigail COLEMAN

<a href=" www.renttobuyguide.co.uk/">rent to buy guide</a>

Tuesday, April 27, 2010 12:05 PM by Abigail COLEMAN

# re: Default Button / Press Enter Key in Web Form

Pretty cool blog you've got here. Thanks for it. I like such themes and everything connected to them. I would like to read more soon.

Julia Benedict

Saturday, August 07, 2010 1:33 AM by brunette London escorts

# re: Default Button / Press Enter Key in Web Form

hsxgoydqxmpvlovfswnsy. <a href=www.acnetreatment2k.com/>acne treatment</a>

gszitv

Sunday, September 05, 2010 11:02 PM by thrhtrurth

# re: Default Button / Press Enter Key in Web Form

It was extremely interesting for me to read the article. Thanks for it. I like such topics and everything connected to this matter. I would like to read more on that blog soon.

Joan Swenson    

<a href="milanescorts.com/">annuncio milano escort</a>

Friday, March 18, 2011 2:36 AM by Joan Swenson

# re: Default Button / Press Enter Key in Web Form

Rather nice place you've got here. Thanx for it. I like such themes and everything that is connected to them. I would like to read a bit more on that blog soon.  

Avril Benedict    

<a href="www.pickescort.com/">private escort</a>

Saturday, April 09, 2011 4:47 PM by Avril Benedict

# re: Default Button / Press Enter Key in Web Form

Wonderful article  at least I thing so. Keep it up!

Kate Frakloop

<a href="escort-bosnia.com/">escorts sarajevo</a>

Monday, November 07, 2011 2:59 AM by KateFrakloop

# re: Default Button / Press Enter Key in Web Form

Appreciate the recommendation. Let me try it out.

Saturday, August 18, 2012 3:27 PM by Espinosa

# re: Default Button / Press Enter Key in Web Form

JheS0e Looking forward to reading more. Great article post.Thanks Again. Keep writing.

Wednesday, September 19, 2012 3:43 PM by bookmarking submission

# re: Default Button / Press Enter Key in Web Form

<a href="ro.downloadstock.biz/.../3D-Business-Icons.html"> Thanks for the help in this question, I too consider, that the easier, the better …</a>

Monday, October 08, 2012 1:48 AM by icons set

# re: Default Button / Press Enter Key in Web Form

3gOVRR Looking forward to reading more. Great article.Thanks Again. Great.

Friday, October 19, 2012 10:15 PM by cheap seo services

# re: Default Button / Press Enter Key in Web Form

rYvYwV I really enjoy the article post.Thanks Again.

Sunday, November 04, 2012 1:09 PM by crork

# re: Default Button / Press Enter Key in Web Form

fabakL This is one awesome blog post. Much obliged.

Sunday, November 25, 2012 11:28 PM by Seo Service

# re: Default Button / Press Enter Key in Web Form

Hi there to all, it's actually a nice for me to visit this website, it consists of valuable Information.

Tuesday, January 01, 2013 3:21 PM by Friend

# re: Default Button / Press Enter Key in Web Form

[url=http://tagawayfacts.com/]skin tags[/url]  severe case of acne but can only provide an acne treatment regimen. Look reflexes. It is also a fabulous wrinkle reducer when applied rather than choosing skin creams that will best work for wrinkles.One thing that invented. carnecks mission is to be a source of self-review online, businesses that earn money. Here are a few tips that will give you

Tuesday, January 08, 2013 3:27 PM by BorErurbtum

# re: Default Button / Press Enter Key in Web Form

Hi there I am so glad I found your website, I really found you by accident, while I was browsing on Digg

for something else, Nonetheless I am here

now and would just like to say cheers for a incredible post and a all round thrilling blog (I also love the theme/design), I don’t have time to read it all at the moment but I have book-marked it and also included

your RSS feeds, so when I have time I will be back to read

much more, Please do keep up the great b.

Wednesday, February 06, 2013 3:49 PM by Macon

# re: Default Button / Press Enter Key in Web Form

Appreciate the recommendation. Let me try it out.

Monday, February 11, 2013 3:46 AM by Carson

# re: Default Button / Press Enter Key in Web Form

There's certainly a great deal to learn about this subject. I really like all of the points you made.

Wednesday, February 13, 2013 7:40 PM by Purcell

# re: Default Button / Press Enter Key in Web Form

This is a topic that's close to my heart... Cheers! Exactly where are your contact details though?

Saturday, February 16, 2013 7:58 AM by Kroll

# re: Default Button / Press Enter Key in Web Form

Incredible points. Outstanding arguments. Keep up the great effort.

Saturday, February 16, 2013 11:05 AM by Fugate

# re: Default Button / Press Enter Key in Web Form

Greetings! This is my first visit to your blog! We are a team of volunteers and starting a new initiative in a

community in the same niche. Your blog provided us valuable information to work on.

You have done a extraordinary job!

Saturday, February 16, 2013 2:37 PM by Dailey

# re: Default Button / Press Enter Key in Web Form

I don't even know the way I stopped up right here, however I believed this post was good. I do not recognize who you're however definitely you're going to a famous blogger if you are not already. Cheers!

Tuesday, February 19, 2013 8:16 AM by Lantz

# re: Default Button / Press Enter Key in Web Form

Hello! I know this is somewhat off topic but I was wondering if you knew where I could get a captcha plugin

for my comment form? I'm using the same blog platform as yours and I'm having trouble finding

one? Thanks a lot!

Tuesday, February 19, 2013 10:16 AM by Valenzuela

# re: Default Button / Press Enter Key in Web Form

Absolutely adore is without a doubt frail found at natal, however gets bigger tougher with each passing year exhibit your hard work properly raised on. code reduction la redoute www.a88.fr/homme-c-1.html

Sunday, February 24, 2013 3:58 AM by jabdade@gmail.com

# re: Default Button / Press Enter Key in Web Form

Hi there, I enjoy reading all of your article

post. I wanted to write a little comment to support you.

Sunday, March 03, 2013 1:39 AM by Trudeau

# re: Default Button / Press Enter Key in Web Form

I'm not sure why but this blog is loading incredibly slow for me. Is anyone else having this problem or is it a problem on my end? I'll

check back later on and see if the problem still exists.

Thursday, March 07, 2013 3:54 PM by Obrien

# re: Default Button / Press Enter Key in Web Form

My partner and I absolutely love your blog and find the majority of your post's to be exactly what I'm looking

for. Does one offer guest writers to write content available for you?

I wouldn't mind writing a post or elaborating on a few of the subjects you write concerning here. Again, awesome weblog!

Thursday, March 07, 2013 7:45 PM by Falcon

# re: Default Button / Press Enter Key in Web Form

I do trust all the concepts you've presented on your post. They are very convincing and will certainly work. Nonetheless, the posts are too short for novices. Could you please prolong them a little from next time? Thanks for the post.

Thursday, March 07, 2013 9:58 PM by French

# re: Default Button / Press Enter Key in Web Form

Attractive part of content. I just stumbled upon your blog and in accession capital to say that I get in fact loved account your blog

posts. Anyway I will be subscribing to your augment and even I success you

access persistently rapidly.

Wednesday, April 03, 2013 12:54 AM by Fuqua

# re: Default Button / Press Enter Key in Web Form

I visited several web pages but the audio feature

for audio songs present at this site is actually superb.

Wednesday, April 03, 2013 10:29 AM by Farris

# re: Default Button / Press Enter Key in Web Form

This blog was... how do I say it? Relevant!! Finally I have found something which

helped me. Many thanks!

Thursday, April 04, 2013 7:41 AM by Romano

# re: Default Button / Press Enter Key in Web Form

I just like the valuable information you provide for your articles.

I will bookmark your blog and check again right here regularly.

I am fairly sure I will learn many new stuff proper right

here! Good luck for the following!

Saturday, April 06, 2013 3:15 AM by Daughtry

# re: Default Button / Press Enter Key in Web Form

Wow, marvelous blog layout! How long have you been blogging for?

you made blogging look easy. The overall look of your

website is excellent, as well as the content!

Saturday, April 06, 2013 12:47 PM by Grayson

# re: Default Button / Press Enter Key in Web Form

Hey! I just wanted to ask if you ever have any issues with hackers?

My last blog (wordpress) was hacked and I ended up losing many months of hard work due to no data backup.

Do you have any solutions to stop hackers?

Saturday, April 06, 2013 2:58 PM by Chapa

# re: Default Button / Press Enter Key in Web Form

Hi there! I just want to offer you a huge thumbs up for your excellent info you have got right here on this post.

I will be returning to your website for more soon.

Monday, April 15, 2013 12:56 PM by Sylvester

Leave a Comment

(required) 
(required) 
(optional)
(required)