CodeVerge.Net Beta
Login Idy
Register Password
  Forgot?
Explore    Item Entry    Members   
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML





Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.master_pages_themes_and_navigation_controls Tags:
Item Type: NewsGroup Date Entered: 1/2/2008 9:56:02 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 3 Views: 10 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
4 Items, 1 Pages 1 |< << Go >> >|
Sara Jo
Asp.Net User
Form Submit On Enter - disable?1/2/2008 9:56:02 PM

0/0

Hi all, could use some ideas on how to fix a problem in ASP.NET - Web Forms.

We use masterpages that have our page navigation and now are adding a sub-menu to be displayed on every page. In the sub menu I put a quick search that includes a text box and a command button named "btnGo".

My problem is, now on "enter" of every page no matter what control you are in it submits "btnGo" and not whichever command button is in the form on the page.

I need the "btnGo" to submit when clicked or when "enter" is pressed when the co-responding text box has focus, and the command button on the page to submit on enter when anything else has focus like it did before I added the control to the master page.

This sounds easy enough to fix, I am finding a lot of involved javascript functions that I could use but I figured I'd put some feelers out to see if anyone had any ideas.

Thank you!


I heart nerds.
mattb
Asp.Net User
Re: Form Submit On Enter - disable?1/2/2008 10:32:50 PM

0/0

I think you answered your own question....   In the search textbox's OnBlur, check if it has a value and then set the focus on btnGo.

For other controls in the page, there is a default button property you can set.   Geeked


Matt Brown
Sara Jo
Asp.Net User
Re: Form Submit On Enter - disable?1/3/2008 4:04:05 PM

0/0

Thank you for your help.

 

If I change the focus on the onBlur wont the textbox lose the focus and therefore the user will not be able to complete typing?

 Also, what is the property name? I think if I have to change a property for all the other controls I will be stuck changing hundreds of controls as I would have to do it on each page that incorporates our masterpage. Is there a better way to do this?

 


I heart nerds.
mattb
Asp.Net User
Re: Form Submit On Enter - disable?1/3/2008 4:42:18 PM

0/0

I believe if you wrap a bunch of controls in a Panel, the Panel itself has a property for the ID of the default button you want to set.


Matt Brown
4 Items, 1 Pages 1 |< << Go >> >|



Search This Site:


Meet Our Sponsors:



Other Resources:

German Characters in Form - macromedia.dreamweaver - Web Programming ... SugarCRM Forums - Submit WebToLead-Form -> no german characters ... coding I must follow to enable the visitor enter the german characters in ...
AS Workshop " Disable form submit on enter keypress Disable form submit on enter keypress March 13, 2005 ... i.e. disable the Enter Key on a form level not just in an elment level. Thanks very much ...
How To: Disable Form Submit on Enter Key Press Sometimes, you need to disable form submission on Enter Key press. ... How To: Disable Form Submit on Enter Key Press. November 02, 2007 by Blogging Developer ...
How to disable the Enter key on HTML form ... a form with several text input fields, it is undesirable that the form gets submitted when the user hits ENTER in a ... to submit the form immediately, ...
Using JavaScript to prevent or trigger form submission when ENTER is hit ... the user hits ENTER and if that would trigger form submission on the browser, ... And naturally it cannot work when client-side scripting is disabled. ...
The Future of the Web " Submit a Form in IE with Enter " HTML, CSS ... ... a select box , and ur focused on it , enter does not submit the form ! ... This will work if javascrit is disabled. 11. Etienne Mac at 6:52am on April 22, 2007 ...
How To Prevent Form Submission When User Presses the ENTER Key on a Form When the focus is on an HTML form, and the user presses the ENTER key, by default, Internet Explorer treats this action as if the user clicks Submit . However, not ...
KBAlertz.com: When the focus is on an HTML form, and the user presses ... When the focus is on an HTML form, and the user presses the ENTER key, by default, Internet Explorer treats this action as if the user clicks Submit . However, not ...
How to Disable the Submit Button of a Web Form - The Blog of Josh Stodola ... to effortlessly disable the submit button of web form(s) upon submission. ... www.bloggingdeveloper.com/post/Disable-Form-Submit-on-Enter-Key-Press.aspx ...
Javascript: Disable enter key within forms However, the 'Enter' key will actually submit the form. ... However, this form is also an example of how you can disable the 'Enter' key on ...


 
All Times Are GMT