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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T06:49:41+00:00 2026-05-15T06:49:41+00:00

I am having a table in which i`m dynamically creating and deleting rows. How

  • 0

I am having a table in which i`m dynamically creating and deleting rows. How can I change the code such that the rows be added and deleted and the model info property filled accordingly.

Bearing in mind that the rows can be dynamically created and deleted, I may have Info[0], Inf0[3], info[4]… My objective is to be able to bind the array even if it`s not in sequence.

Model

public class Person
    {
        public int[] Size { get; set; }
        public string[] Name { get; set; }
        public Info[]info { get; set; }
    }

    public class Info
    {
        public string Address { get; set; }
        public string Tel { get; set; }

View

    <script type="text/javascript" language="javascript">
        $(function () {

            var count = 1;

            $('#AddSize').live('click', function () {
                $("#divSize").append('</br><input type="text" id="Size" name="Size" value=""/><input type = "button" id="AddSize" value="Add"/>');

            });

            $('#AddName').live('click', function () {
                $("#divName").append('</br><input type="text" id="Name" name="Name" value=""/><input type = "button"  id="AddName" value="Add"/>');

            });

            $('#AddRow').live('click', function () {
                $('#details').append('<tr><td>Address</td><td> <input type="text"  name="Info[' + count + '].Address"/></td><td>Tel</td><td><input type="text"  name="Info[' + count++ + '].Tel"/></td> <td><input type="button" id="AddRow" value="Add"/> </td></tr>');
            });




        });        
       </script>
</head>

<body>
  <form id="closeForm" action="<%=Url.Action("Create",new{Action="Create"}) %>" method="post" enctype="multipart/form-data">
    <div id="divSize">
    <input type="text" name="Size"  value=""/> <input type="button" value="Add" id="AddSize" />
    </div>


    <div id="divName">
    <input type="text" name="Name"  value=""/> <input type="button" value="Add" id="AddName" />
    </div>


    <div id="Tab">
    <table id="details">
       <tr><td>Address</td><td> <input type="text"  name="Info[0].Address"/></td><td>Tel</td><td><input type="text"  name="Info[0].Tel"/></td> <td><input type="button" id="AddRow" value="Add"/> </td></tr>
    </table>

    </div>

    <input type="submit" value="Submit" />
    </form>


</body>
 }

Controller

public ActionResult Create(Person person)
        {
            return new EmptyResult();
        }
  • 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-15T06:49:42+00:00Added an answer on May 15, 2026 at 6:49 am

    Here’s a nice blog post that you might find helpful.

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

Sidebar

Related Questions

I'm having a table in which i'm creating a label dynamically. '<td>' + '<label
I have simple table that has about 80 rows, which I populate dynamically using
I have a table in database that is having some fields one of which
The table will get generated dynamically from the server-side code, which I have to
I have been having some trouble to select the rows of my table which
I am having a page that loads content dynamically. Depending on which menu item
I have a table form which contains a part where the rows can be
I am having a table which has the fields: staff_id , leave_applied_from , leave_applied_to
I am having a table in which we have some 20 million entries inserted(blind
I am having a table called Tl which consists of fields ID,Name and Course.

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.