Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 352483
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T11:44:29+00:00 2026-05-12T11:44:29+00:00

Consider the following: <form runat=server> <div> <asp:TextBox runat=server ID=tb1 /> <asp:Button runat=server ID=b1 OnClick=b1_Click

  • 0

Consider the following:

<form runat="server">
    <div>
        <asp:TextBox runat="server" ID="tb1" />
        <asp:Button runat="server" ID="b1" OnClick="b1_Click" />
    </div>

    <div>
        <asp:TextBox runat="server" ID="tb2" />
        <asp:Button runat="server" ID="b2" OnClick="b2_Click" />
    </div>

    <div>
        <asp:TextBox runat="server" ID="tb3" />
        <asp:Button runat="server" ID="b3" OnClick="b3_Click" />
    </div>
</form>

Each TextBox has an associated Button. I want to be able to switch the focus on each of these Button controls, so that when I place my cursor in the 2nd textbox (tb2) and press Enter, the associated button (b2) gets clicked and the associated OnClick event gets fired.

I’ve got a few ideas myself, but I’d like you guys’ feedback/lessons-learned before I start potentially wasting time on implementing a broken solution.

NOTE:

  • Using the HTML fieldset element is not an option–Some of the interfaces are very complex.
  • There can be multiple inputs associated with one button.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T11:44:29+00:00Added an answer on May 12, 2026 at 11:44 am

    You could trap the keydown event on the Textbox and then fire the button’s callback javascript if it’s the enter key. You can get the callback reference using ClientScriptManager.GetPostBackEventReference

    Alternatively you could wrap every textbox in it’s own Panel, which exposes a DefaultButton property.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to do following: <asp:Login id=loginControl OnAuthenticate=loginControl_Authenticate runat=server> <LayoutTemplate> <asp:TextBox id=UserName runat=server
Consider the following simple WinForms form with a textbox and a webbrowser control. Whenever
Consider the following scenario. I am clicking the submit button of a JSF form,
Consider the following code : class TestTimerGC : Form { public TestTimerGC() { Button
Please consider the following signup: <form wicket:id=form> <div wicket:id=fooList> <input wicket:id=fooList.quxField type=text size=10/> </div>
Consider the following form containing textfield and submit button: <form method=POST action=<?php isValid();?> class=urln>
Consider the following form: <form action="/a" method="post"> <input name="x" type="text" onblur="myonblur(e)" /> <input name="y"
What web development frameworks natively support JasperReports? Consider the following form as an example:
Consider a nonlinear least squares model in R, for example of the following form):
Please consider the following code, <form action=index.php method=post name=adminForm enctype=multipart/form-data> <input type=hidden name=showtime[] id=showtime_1

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.