Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > User Controls with Form fields & Multiple Submits

Thread Tools

User Controls with Form fields & Multiple Submits

Posts: n/a
Let's say I have a page which contains a bunch of text boxes and a Button.
Then, also on the same page, I have a User Control I've created which has two
text boxes and a button of its own.

Here's my problem: In this case, when someone's typing in the textboxes on
the page itself and they press the ENTER key, OR if they're typing in the
text boxes of the UserControl and they press the ENTER key, how do I make
sure that the proper submit button receives the click?

In old fashioned HTML, this was done by creating multipple FORMs on a page
and then the browser handled it. In ASP.NET I really don't know what to do.
Do I have to right client-side JavaScript? If so, what do I have to do? Do I
have to create a JS function for each time an onfocus occurs on every text
box of the page? If so, what would that JS do? Or is there a property of the
TextBox object which allows you to automatically define the default "Button"
it pushes if the user hits enter?


Reply With Quote
Posts: n/a
Hi Alex,

You can actually set which is the primary submit button for a page.

Several links about this, here are a couple:

If that doesn't help, search for "" "enter key" on google.

Hope that helped.


Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple Submits in HTML Forms - Cherrypy Maurice LING Python 2 03-18-2008 09:25 AM
Validation controls validate before form submits TS ASP .Net Web Controls 5 06-28-2005 02:23 PM
newbie question on multiple submits in page jpf Javascript 0 04-22-2004 03:15 PM
Form with multiple submits, but pressing enter focuses on the wrong button Matthew Sims Javascript 0 03-04-2004 06:10 PM
multiple form submits happening on window close Kuntal Joisher Javascript 0 09-06-2003 03:05 AM