Velocity Reviews - Computer Hardware Reviews

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

Reply
Thread Tools

User Controls with Form fields & Multiple Submits

 
 
=?Utf-8?B?QWxleCBNYWdoZW4=?=
Guest
Posts: n/a
 
      05-07-2006
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?

Confused.

Alex
 
Reply With Quote
 
 
 
 
V
Guest
Posts: n/a
 
      05-07-2006
Hi Alex,

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

Several links about this, here are a couple:
http://www.allasp.net/enterkey.aspx
http://www.beansoftware.com/ASP.NET-...Enter-Key.aspx

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

Hope that helped.

Regards,
Vaibhav

 
Reply With Quote
 
 
 
Reply

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



Advertisments