Link to home
Start Free TrialLog in
Avatar of suchandsuch
suchandsuch

asked on

Change Focus for Submit Buttons When Users Presses Enter in AJAX .NET Forms

Hello,

I have an AJAX ASP.NET form that uses a masterpage and C# on the code-behind.

My problem is, that one of the first elements on the page is an ImageButton that is in the masterpage.  I have many different areas of the page that consist of one or two text boxes, that are associated (or intended to be associated) with a submit button.  When a user fills out the required information for any one of these areas (by filling out the one or two text boxes) and presses the enter key, the first ImageButton is fired, instead of the submit button that is associated with the one or two textboxes.  The user expects the submit button associated with the  one or two textboxes to be fired/clicked instead (since the user was working in that area of the page).

Is there anyway that I can ensure that when a user is working in one of these areas of the page (i.e. they've filled out a couple of these textboxes) that the associated (or intended) submit button's click event is fired?

Thank You!
ASKER CERTIFIED SOLUTION
Avatar of GuitarRich
GuitarRich
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of suchandsuch
suchandsuch

ASKER

Thank you GuitarRich, that was EXACTLY what I was hoping for.