WorldofASP.NET : ASP.NET Directory, Tutorial, Hosting, and Source Code
You are 1 of 254 users


Two Common Pitfalls When Submitting a Web Form Using the Enter Key

Blogger : 4GuysFromRolla.com Headlines
All posts : All posts by 4GuysFromRolla.com Headlines
Category : ASP.NET
Blogged date : 2008 Jan 09

When filling out a form on a web page you have probably experienced the fact that if you hit enter when typing in a single-line textbox the form is submitted. This is a feature that browsers provide to make it possible to submit a form without having to touch the mouse. For example, when visiting Google's homepage focus is immediately set to the search textbox and, after typing in your query, you can hit Enter to submit the form and see the results.

Since it is the browser that submits the form when the Enter key is pressed, you might think that as an ASP.NET developer you do not have to worry about this functionality. Just create a Web Form, like always, and the user can optionally use the Enter key to submit the form. Unfortunately, the life of an ASP.NET developer is never that simple! There are two cases where the user hitting Enter doesn't result in the desired behavior. The first case involves a page with multiple Submit buttons. Hitting Enter has the effect of submitting the form using the first Submit button on the page, although you may mean for a different button to have caused the submit (because you want its Click event handler to execute). The second case involves hitting Enter in a form with only one form field when using Internet Explorer.

In this article we will examine these two cases in detail and look at simple workarounds. Read on to learn more!
Read More >


Read comments or post a reply to : Two Common Pitfalls When Submitting a Web Form Using the Enter Key
Page 789 of 1924
Next | Last

.NET News Categories








Legend : - Within 3 Days - Within 6 Days - Within 9 Days

Home | Add Resources | Sponsored Listings | Advertise with Us | SiteMap 1 | SiteMap 2 | Link To Us | Contact Us
© 2002-2008 Worldofasp.net ASP.NET Directory, Hosting and Tutorials | All rights reserved
Our Partners : ASP.NET Web Hosting | Windows Web Hosting | ASP.NET Hosting | Phone Card | PHP Directory | Bangkok Hotels |Calling Card