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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T22:22:08+00:00 2026-05-20T22:22:08+00:00

Dear Experts, I am following Mr.Steve Sanderson Example for working with variable length list,

  • 0

Dear Experts,
I am following Mr.Steve Sanderson Example for working with variable length list, ASP.NET MVC 2-style.

In my Scenario I have one text box in which a user scan through a barcode scanner and the value of scanned barcode will distributed in variable list input fields.

I am using JQuery to set Values of those generated fields,

Example of dynamically Generated DIV is

<div class="editorRow">
<input type="hidden" name="gifts.index" autocomplete="off" value="a041d40e-d016-4543-b3f1-bf72239e1377" />

   Area Code <input id="gifts_a041d40e-d016-4543-b3f1-bf72239e1377__AreaCode" name="gifts[a041d40e-d016-4543-b3f1-bf72239e1377].AreaCode" type="text" value="0" /> 
   Account No: <input id="gifts_a041d40e-d016-4543-b3f1-bf72239e1377__ConsCode" name="gifts[a041d40e-d016-4543-b3f1-bf72239e1377].ConsCode" type="text" value="0" /> 
   Amount: <input id="gifts_a041d40e-d016-4543-b3f1-bf72239e1377__CAmount" name="gifts[a041d40e-d016-4543-b3f1-bf72239e1377].CAmount" type="text" value="0" /> 
   Coll No: <input Value="1" id="gifts_a041d40e-d016-4543-b3f1-bf72239e1377__CollNo" name="gifts[a041d40e-d016-4543-b3f1-bf72239e1377].CollNo" type="text" value="1" /> 
   <a href="#" class="deleteRow">delete</a>

    <span class="field-validation-valid" id="gifts_a041d40e-d016-4543-b3f1-bf72239e1377__AreaCode_validationMessage"></span>
    <span class="field-validation-valid" id="gifts_a041d40e-d016-4543-b3f1-bf72239e1377__ConsCode_validationMessage"></span>
    <span class="field-validation-valid" id="gifts_a041d40e-d016-4543-b3f1-bf72239e1377__CAmount_validationMessage"></span>

if you see there is one hidden field having index and value=”a041d40e-d016-4543-b3f1-bf72239e1377″ which is common in other members with their names. When I add one more DIV the hidden input value again change and all members of that div having the same common value.

I am stuck how to deal with it, so far I have successfully distributed the value of scan barcode to the input boxes which are out side of that dynamic DIVs like:

$("#ScanBCode").keyup(function (e) {
barCode = $("#ScanBCode").val();
if (barCode.length == 21) {
    var count = 1;
    Checking(count);
}

function Checking(count) {
    var code = barCode.substr(2, 3);
    var ACode = barCode.substr(5, 3);
    var Ccode = barCode.substr(8, 5);
    var Amount = barCode.substr(13, 8) / 1000;
    $("#TabACode").val(ACode);
    $("#TabCCode").val(Ccode);
    $("#TabAmount").val(Amount);
    $("#TabCollNo").val(code);
    $("#ScanBCode").val("");
}

});

Any Idea

  • 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-20T22:22:09+00:00Added an answer on May 20, 2026 at 10:22 pm

    not sure wheter i got this one right, but it seems you’re looking for a way to loop over a jquery collection, which can be done using jQuery.each.

    so instead of watching out for some generated IDs on your input field, i’d recommend looping over all of your generated ‘fields’, itentified by their class editorRow. just note that instead of having a separate id for each input field, you’d have to set some class on them, for example:

    <div class="editorRow">
       <!-- set a class on your input fields -->
       Area Code <input class="areaCode" type="text" value="..." />
    </div>
    

    now you can apply the following javascript inside of your keyup handler:

    $('.editorRow').each(function(){
      var $row = $(this);
      $('.areaCode', $row).val('somevalue');  //do this for all of your input fields
    });
    

    just post back in case something isn’t clear here.

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

Sidebar

Related Questions

Dear Stacktoverflow, can you show me an example of how to use a QScrollBar?
Dear g++ hackers, I have the following question. When some data of an object
Given a document written with normal quotes, e.g. Ben said buttons, dear sir. I

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.