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

The Archive Base Latest Questions

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

This is my spring form code in jsp. <div id=mainDiv> <div id=itWillRepeat> <table> <tbody>

  • 0

This is my spring form code in jsp.

<div id="mainDiv">
    <div id="itWillRepeat">
        <table>
            <tbody>
                   <tr>
                      <td>1</td>
                      <td>item</td>
                      <td>item</td>
                      <td>
                        <form:label path="list[${itemsRow.index}].number">4</form:label>
                        <form:hidden path="list[${itemsRow.index}].number" />
                      </td>
                   </tr>
            </tbody>
        </table>
    </div>
</div>

Browser renders and generates HTML code for 4th <td> tag as:

<label for="list4.seq">4</label>
<input type="hidden" value="4" name="list[4].seq" id="list4.seq">

It shows value in browser as:

1  item  item  4

I want to change both the values of <form:label and <form:hidden on any event like onClick through simple JavaScript. I mention just one div with id itWillRepeat here. There can be many divs with id itWillRepeat because it will come in loop and I want to change values of all <form:label in ascending order.

  • 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-24T16:27:58+00:00Added an answer on May 24, 2026 at 4:27 pm
    button.onclick = function() {
        var rep = document.getElementById("mainDiv").getElementsByTagName('div');
           for (i = 0; i < rows.length; i++) {
                //get first label
                var label = rep.getElementsByTagName("label")[0]; 
    
                 label.innerHTML = i+1;
                 //get first input
                 var hidn = rep.getElementsByTagName("input")[0];
                  hidn.value = i+1;
             }
    };
    

    It will get all labels/hidden fields change their values and sort them.

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

Sidebar

Related Questions

Is such html code page jsp? <form action=> <div align=center><textarea name= cols=50 rows=4>welcome to
This is a bit special: I'm loading some HTML in string form into the
I'm escaping all the string parameters I receive from a php form like this:
How can I the HTML string <br> from this HTML FORM pass to the
I recently used the <<- operator to output a multi-line string, like this: <<-form
I have this Spring config: <bean id=boo class=com.x.TheClass/> The class TheClass implements TheInterface .
I have something like this in my Spring Application: public class Book{ public Book(){
I notice that there is getWebApplicationContext in org.springframework.web.servlet.mvc.AbstractController . This means that spring programmers
This is an example of using ThrowawayController in Spring MVC: public class DisplayCourseController implements
This is a basic question - when spring bean is loaded and if 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.