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

  • Home
  • SEARCH
  • 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 8763109
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T15:42:13+00:00 2026-06-13T15:42:13+00:00

I´m a bit confused here. The thing is that I have an asp.net textbox

  • 0

I´m a bit confused here. The thing is that I have an asp.net textbox that I want to tab to the next textbox when maxlength is true and the user does not hit certain keys. My asp.net code is like this:

<asp:TextBox ID="txbTransferBanknumber" Style="width: 50px;" MaxLength="4" 
Visible="true" runat="server" autocomplete="off"    onkeyup="autoTabNextTextBox(this,'txbTransferLedger')" CssClass="AutoTabFill" />

my autoTabNextTextBox function looks like this:

function autoTabNextTextBox(sender, nextTextBox) {

    var keyCode = (event.which) ? event.which : event.keyCode
    var mylength = $(sender).val().length;
    var maxlength = $(sender).attr('maxLength');

    if((keyCode != 37) && (keyCode != 39))
    {
        if ((keyCode != 8) && (keyCode != 16))
        {
            if (mylength == maxlength)
            {   
                $('.nextTextBox').focus();
                //nextTextBox.focus();                    
            }
        }
    }

}

How do I pass the parameter nextTextBox to .focus() ?

  • 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-06-13T15:42:14+00:00Added an answer on June 13, 2026 at 3:42 pm

    Assuming that you have a ClientIdMode of Static (meaning the id of the output HTML element is txbTransferLedger) then you just need to include the nextTextBox parameter as part of the selector (as opposed to the string nextTextBox which you are currently using):

    $('#' + nextTextBox).focus();
    

    Update: If you cannot use a ClientIdMode of Static and therefore don’t have full control over the generated ids of the input elements then another option is to use a class selector instead. Give each input element a unique class name (this can be in addition to any existing classes you are using) e.g.:

    <asp:TextBox ID="txbTransferLedger" CssClass="AutoFill TransferLedger" />
    

    Then pass the the class name you want (TransferLedger in this example) into the autoTabNextTextBox function instead of the ID. You can then use a class selector as follows:

    $('input.' + nextTextBox).focus(); // e.g. $('input.TransferLedger').focus();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Bit confused here, I have an on-demand instance but do I get charged even
I have a ASP.NET bulleted list control that, until today, was created and used
I'm a bit confused by the documentation here. I have a transaction, which start
I'm a bit confused on setting up the boost test library. Here is my
I've seen various questions here pertaining to saving NSArrays/NSDictionaries, but I'm a bit confused
after reading the cookbook and various Q&A here I am still a bit confused
I'm a bit confused by the Lucene.NET API, but, it may just be a
I'm doing some ASP.NET development in VS and have just found an interesting little
I have create a segmented button in android , now i am bit confused
Alright, I'm confused as hell. I have an object that I store in a

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.