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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T18:14:30+00:00 2026-05-28T18:14:30+00:00

I am working on a form that user can add rows as he wants

  • 0

I am working on a form that user can add rows as he wants to. There is a link named “add row”, When it clicked, I want to clone a hidden table and change it’s name values, some of class names. could anyone help me about this?

<table class="montaj montaj-satir">
    <tr>
        <td width="62px"><input type="text" name="oper[--number--][kodu]" size="4" maxlength="4" /></td>
        <td width="38px">
            <input type="checkbox" name="oper[--number--][onay]" value="1" />
            <input type="hidden" name="oper[--number--][terminal_hatasi]" value="0" />
            <input type="hidden" name="oper[--number--][soket_hatasi]" value="0" />
            <input type="hidden" name="oper[--number--][montaj_hatasi]" value="0" />
            <input type="hidden" name="oper[--number--][yon_hatasi]" value="0" />
            <input type="hidden" name="oper[--number--][push_hatasi]" value="0" />
            <input type="hidden" name="oper[--number--][olcu_hatasi]" value="0" />
            <input type="hidden" name="oper[--number--][bant_hatasi]" value="0" />
            <input type="hidden" name="oper[--number--][vida_hatasi]" value="0" />
            <input type="hidden" name="oper[--number--][komponent_hatasi]" value="0" />
        </td>
        <td width="62px"><span class="terminal_hatasi--number--">0</span> <a href="#" class="add hata-ekle" id="terminal_hatasi--number--">&nbsp; &nbsp; &nbsp;</a></td>
        <td width="62px"><span class="soket_hatasi--number--">0</span> <a href="#" class="add hata-ekle" id="soket_hatasi--number--">&nbsp; &nbsp; &nbsp;</a></td>
        <td width="62px"><span class="montaj_hatasi--number--">0</span> <a href="#" class="add hata-ekle" id="montaj_hatasi--number--">&nbsp; &nbsp; &nbsp;</a></td>
        <td width="62px"><span class="yon_hatasi--number--">0</span> <a href="#" class="add hata-ekle" id="yon_hatasi--number--">&nbsp; &nbsp; &nbsp;</a></td>
        <td width="62px"><span class="push_hatasi--number--">0</span> <a href="#" class="add hata-ekle" id="push_hatasi--number--">&nbsp; &nbsp; &nbsp;</a></td>
        <td width="62px"><span class="olcu_hatasi--number--">0</span> <a href="#" class="add hata-ekle" id="olcu_hatasi--number--">&nbsp; &nbsp; &nbsp;</a></td>
        <td width="62px"><span class="bant_hatasi--number--">0</span> <a href="#" class="add hata-ekle" id="bant_hatasi--number--">&nbsp; &nbsp; &nbsp;</a></td>
        <td width="62px"><span class="vida_hatasi--number--">0</span> <a href="#" class="add hata-ekle" id="vida_hatasi--number--">&nbsp; &nbsp; &nbsp;</a></td>
        <td width="62px"><span class="komponent_hatasi--number--">0</span> <a href="#" class="add hata-ekle" id="komponent_hatasi--number--">&nbsp; &nbsp; &nbsp;</a></td>
    </tr>
    <tr>
        <td colspan="2">Kablo Sıra No</td>
        <td colspan="4"><input type="text" name="oper[--number--][kablo_sira_no]" value="" /></td>
        <td colspan="2">Açıklama</td>
        <td colspan="3"><input type="text" name="oper[--number--][aciklama]" value="" /></td>
    </tr>
</table>

the links that have .hata-ekle class, increasing the value of hidden input and the span next to it.

If there is needed for a new row, user should click “add row” link and new cloned .montaj table should appear but --number-- should be replaced with a unique number.

How can I do this?

Thanks…

  • 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-28T18:14:31+00:00Added an answer on May 28, 2026 at 6:14 pm

    OK,

    I don’t understand the whole process but I can give you some pointers :

    1. First method : you write a function taking needed number in parameter and creating the table with jQuery utilities :

      function addTable(number) {
        var table = $('<table>');
        var tr = $('<tr>').appendTo(table);
        var td = $('<td>').appendTo(tr);
        var span = $('<span>').appendTo(td).addClass('terminal_hatasi'+number)
        ...
      }
      
    2. Second method : you clone you table and then you search your input/span and retag it :

      function addTable(number) {
        var clone = $('table.montaj').first().clone();
      
        clone.find('input').each(function(item){
          var name = $(this).attr('name');
          $(this).attr('name',name.replace(/\d/,number));
        });
      
        ...
      
        $(body).append(clone);
      }
      

    I think there is even more approach, these are the two came first to my mind. These are not necessarily the betters…

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

Sidebar

Related Questions

I have an HTML form that a user can add an arbitrary amount of
I'm working on a Rails app that sends data through a form. I want
I am working a project currently in which the user can add multiple news
I'm working on a form where when user clicks add server a div block
I have working script that the user completes inputs on a form and when
I'm working on an Excel add in that opens a winform after the user
I have a form that allows the user to add information an their leisure.
I'm working on a form that will display links to open different types of
I am working on a form that adds employee information to a MySQL table
I'm working on a long form that has several radio button groups. At the

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.