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 6196095
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T03:34:57+00:00 2026-05-24T03:34:57+00:00

On a ASP.NET MVC 2 form , i am asking user to insert 16

  • 0

On a ASP.NET MVC 2 form , i am asking user to insert 16 digit bank account number . User has 16 different textboxes for each digit of bankaccount number . User has to re enter same bank account number in another 16 textboxes .. if previously entered bank account number matches with re entered bank account number then I want to display an error message or alert .

i have 16 textboxes having only one digit value .. i want to pass all of these values and make a string of it .. how to do this using Jquery ? I tried this same thing with javascript but only problem is that it doesnt add my first textbox value first time but it adds it to a string only when i keep typing in my other 2 textboxes and after that only my first textbox value gets added into a string … Actually I have 17 textboxes … and i am trying to store values of 16 textboxes into 17th textbox which has hidden attribute ? I need a Jquery code for this because i think that javascript isnt a good option for this …

EDIT:- I have another requirement above thing is for submitting a bank account number but what about Updating it ?? so far i have done like this and its not working .. debugger cannt find a keyUp event for class=”ac” or anything.

     <div class="alert-date-field">

        <div class="alert-labelfield">
            <%: Html.Label("Account Number") %>
        </div>
    <div  style=" float:right; width:495px;" >
     <input type="text" maxlength="1" size="10px" class="ac" id="ac1"    />
    <input type="text" maxlength="1" size="10px" class="ac" id="ac2"   />
    <input type="text" maxlength="1" size="10px" class="ac" id="ac3"    />
    <input type="text" maxlength="1" size="10px" class="ac" id="ac4"   />
    <input type="text" maxlength="1" size="10px" class="ac" id="ac5"  />
    <input type="text" maxlength="1" size="10px" class="ac" id="ac6"    />
   <input type="text" maxlength="1" size="10px" class="ac" id="ac7"   />
   <input type="text" maxlength="1" size="10px" class="ac" id="ac8"  />
   <input type="text" maxlength="1" size="10px" class="ac" id="ac9"   />
   <input type="text" maxlength="1" size="10px" class="ac" id="ac10"  />
   <input type="text" maxlength="1" size="10px" class="ac" id="ac11"  />
   <input type="text" maxlength="1" size="10px" class="ac" id="ac12"  />
   <input type="text" maxlength="1" size="10px" class="ac" id="ac13"  />
   <input type="text" maxlength="1" size="10px" class="ac" id="ac14"   />
   <input type="text" maxlength="1" size="10px" class="ac" id="ac15"   />
    <input type="text" maxlength="1" size="10px" class="ac" id="ac16"   />
  <%: Html.TextBoxFor(model => model.EFTUpdateAccountDescriptor.BankAccountNo, new { ID = "bankaccountnumber", maxlength = "16", Style = " width : 120px;" })%>
                        </div>
                     </div>
    <script type="text/javascript">
 $(document).ready(function () {
     document.getElementById('ReABNumber').value = "";
     document.getElementById('RfinalAcntNumber').value = "";
     //  document.getElementById('').value;
    // debugger;
     var jqAcnt = document.getElementById('bankaccountnumber').value;
     var jqAbNum = document.getElementById('finalABNumber').value;
     var inpAcnt = jqAcnt;
     var inpAcntArray = new Array(
                     (inpAcnt.charAt(0)),
        (inpAcnt.charAt(1)),
        (inpAcnt.charAt(2)),
        (inpAcnt.charAt(3)),
        (inpAcnt.charAt(4)),
        (inpAcnt.charAt(5)),
        (inpAcnt.charAt(6)),
        (inpAcnt.charAt(7)),
         (inpAcnt.charAt(8)),
         (inpAcnt.charAt(9)),
         (inpAcnt.charAt(10)),
         (inpAcnt.charAt(11)),
         (inpAcnt.charAt(12)),
         (inpAcnt.charAt(13)),
         (inpAcnt.charAt(14)),
         (inpAcnt.charAt(15))
     );
     document.getElementById('ac1').value = inpAcntArray.slice(0, 1);
     document.getElementById('ac2').value = inpAcntArray.slice(1, 2);
     document.getElementById('ac3').value = inpAcntArray.slice(2, 3);
     document.getElementById('ac4').value = inpAcntArray.slice(3, 4);
     document.getElementById('ac5').value = inpAcntArray.slice(4, 5);
     document.getElementById('ac6').value = inpAcntArray.slice(5, 6);
     document.getElementById('ac7').value = inpAcntArray.slice(6, 7);
     document.getElementById('ac8').value = inpAcntArray.slice(7, 8);
     document.getElementById('ac9').value = inpAcntArray.slice(8, 9);
     document.getElementById('ac10').value = inpAcntArray.slice(9, 10);
     document.getElementById('ac11').value = inpAcntArray.slice(10, 11);
     document.getElementById('ac12').value = inpAcntArray.slice(11, 12);
     document.getElementById('ac13').value = inpAcntArray.slice(12, 13);
     document.getElementById('ac14').value = inpAcntArray.slice(13, 14);
     document.getElementById('ac15').value = inpAcntArray.slice(14, 15);
     document.getElementById('ac16').value = inpAcntArray.slice(15);
     var updateAct = document.getElementById('RfinalAcntNumber').value;
     var abArray = new Array((jqAbNum.charAt(0)),
        (jqAbNum.charAt(1)),
        (jqAbNum.charAt(2)),
        (jqAbNum.charAt(3)),
        (jqAbNum.charAt(4)),
        (jqAbNum.charAt(5)),
        (jqAbNum.charAt(6)),
        (jqAbNum.charAt(7)),
         (jqAbNum.charAt(8)),
         (jqAbNum.charAt(9))
     );
     document.getElementById('ab1').value = jqAbNum.slice(0, 1);
     document.getElementById('ab2').value = jqAbNum.slice(1, 2);
     document.getElementById('ab3').value = jqAbNum.slice(2, 3);
     document.getElementById('ab4').value = jqAbNum.slice(3, 4);
     document.getElementById('ab5').value = jqAbNum.slice(4, 5);
     document.getElementById('ab6').value = jqAbNum.slice(5, 6);
     document.getElementById('ab7').value = jqAbNum.slice(6, 7);
     document.getElementById('ab8').value = jqAbNum.slice(7, 8);
     document.getElementById('ab9').value = jqAbNum.slice(8);

 });
 $('.ac').keyup(function () {
     debugger;
     var elem17 = $('#bankaccountnumber').val('')[0];
     $('.ac').each(function () {
         elem17.value += this.value;
     });
 });
 $('.reAC').keyup(function () {

     var elem1 = $('#RfinalAcntNumber').val('')[0];
     $('.ac').each(function () {
         elem1.value += this.value;
     });
 });
 $('.ab').keyup(function () {

     var ele17 = $('#finalABNumber').val('')[0];
     $('.ab').each(function () {
         ele17.value += this.value;
     });
 });
 $('.reAB').keyup(function () {

     var ele1 = $('#ReABNumber').val('')[0];
     $('.reAB').each(function () {
         ele1.value += this.value;
     });
 });
   </script>
  <style type="text/css">
    .ac{width:15px;}    
    .reAC{width:15px;}
    .ab{width:15px;}
     .reAB{width:15px;}
    </style>
  • 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-24T03:34:57+00:00Added an answer on May 24, 2026 at 3:34 am

    update
    If you want it to happen while you are typing, then bind to the keyup event of the input boxes..

    $('.digit').keyup(function(){
    
        var elem17 = $('#elem17').val('')[0];
        $('.digit').each(function(){
          elem17.value += this.value;
        });
    
    });
    

    updated demo at http://jsfiddle.net/gaby/NNRtt/1/


    Original answer

    You can add a class to these elements class="digit" and then do

    var elem17 = $('#element17id').val('')[0];
    $('.digit').each(function(){
      elem17.value += this.value;
    });
    

    The above is assuming that with textbox you mean input elements of type="text".

    demo at http://jsfiddle.net/gaby/NNRtt/


    If you mean some other kind of element like span or div.. then use

    var alltext = '';
    $('.digit').each(function(){
      alltext += $(this).text();
    });
    $('#element17id').text( alltext );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a form in an ASP.NET MVC site which the user can edit
I have a html form(ASP.Net MVC). The input textboxes are wrapped in a div
I am working on a ASP.NET MVC web site which has a form that
When you have an ASP.Net MVC form created by Html.BeginForm(), how do fields inside
I have an ASP.NET MVC form for adding a module to a site. The
In a asp.net mvc form, im using a radiobutton set, to set a property.
I have an ASP.NET MVC form that when submitted can return either an ActionResult
I am trying to create a custom authentication scheme in ASP.NET MVC using form
ASP.NET MVC seems to correctly automatically bind between HTML form's file input field and
Using ASP.NET MVC there are situations (such as form submission) that may require 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.