tags:

views:

172

answers:

4

I have an ASP.NET page with two sections on it... one for registration, one for login... each having a submit button.

When i'm in the login part of the page, i want the first 'submit' button to engage when 'Enter' is depressed. When in the registration part, i want the 2nd 'submit' button to engage when 'Enter is depressed.

Problem: I need the page to be accessible (i.e. i'm not allowed to use javascript)

Anyone got any ideas? :) :(

A: 
William Brendel
This is the right way to go. Login and Registration are two different actions and thus must have 2 separate forms. But good luck doing that with asp.net webforms!
Chetan Sastry
Yeh... ASP.NET won't allow two forms on one page!!! :(
Stephen
Yikes, that's a glaring limitation if I've ever seen one. Too bad...
William Brendel
WHAT THE!!!???? No more than ONE form with ASP.NET??? Oh my god I think I'm having a stroke
baeltazor
+2  A: 

If the two submits are in different forms (and it sounds as if they should be in this instance) there is no issue. Any sane browser will take the submit button from the form you are in.

Williham Totland
They're in the same form... :(
Stephen
That throws the "sane" option right out the window, doesn't it... If you can't finagle separate forms for the two actions, there's really nothing to do for it.
Williham Totland
A: 

Wrap your controls in panels, then set the default button property of the panel to the desired button.

http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.panel.defaultbutton.aspx

BigBlondeViking
Uses javascript internally I believe.
Chetan Sastry
A: 

They're in the same form... :(

Well, can you not change that? Unless they share fields, they shouldn't have to be in the same form. ‘login’ and ‘register’ sound like two different functions to me.

There is no pure-HTML way to specify a default submit button, much less different default buttons in different circumstances.

Including JavaScript does not in itself make your page inaccessible. As long as it still works with JavaScript off you're fine.

bobince