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

  • Home
  • SEARCH
  • 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 8138037
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T11:22:11+00:00 2026-06-06T11:22:11+00:00

I have my form in a table and I use this code to add

  • 0

I have my form in a table and I use this code to add new row with new fields:

$("input.buttonCAdd").click(function(){ 
    $('#table > tbody > tr').eq(2).after('<tr><td width=\"25%\"><b>Substancje czynna:</b></td><td width=\"25%\"><select name=\"nazwamiedzynarodowa[]\"><option selected=\"selected\">nazwa1</option><option>nazwa2</option></select></td><td> Dawka: <br><input name=\"dawka[]\" type=\"text\"> <br></td><td>Jednostka:<br><select name=\"jednostka[]\"><option selected=\"selected\">jed1</option><option>jed2</option></select></td> </tr>')
});

That works ok, but my form “doesn’t see” new fields and I don’t get data from that fields. How can I fix it?

  • 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-06-06T11:22:12+00:00Added an answer on June 6, 2026 at 11:22 am

    I am not sure if this can help you, but I guess the problem may be here:
    ” If the HTML is more complex than a single tag without attributes, as it is in the above example, the actual creation of the elements is handled by the browser’s innerHTML mechanism. ” Quoted from jQuery docs (see also 2) I guess if you avoid innerHTML, it can work. Try to use standard javascript methods:

    //new row
    var newrow = document.createElement('tr'); // creates empty row
    
    //1st cell
    var newcell = newrow.insertCell(0); // create and insert empty cell to newrow + returns cell reference
    newcell.style.width = '25%';
    newcell.style.fontWeight = 'bold';
    newcell.appendChild(document.createTextNode('Substancje czynna:'));
    
    //2nd cell
    var newcell = newrow.insertCell(1);
    newcell.style.width = '25%';
    var newselect = document.createElement('select');
    newselect.setAttribute('name', 'nazwamiedzynarodowa[]');
    newselect.options[0] = new Option('nazwa1', 'opt1');
    newselect.options[1] = new Option('nazwa2', 'opt2');
    newselect.options[0].selected = true;
    newcell.appendChild(newselect);
    
    //3rd cell
    var newcell = newrow.insertCell(2);
    newcell.appendChild(document.createTextNode(' Dawka: '));
    newcell.appendChild(document.createElement('br'));
    
    //4th cell
    var newcell = newrow.insertCell(3);
    var newselect = document.createElement('select');
    newselect.setAttribute('name', 'jednostka[]');
    newselect.options[0] = new Option('jed1', 'opt1');
    newselect.options[1] = new Option('jed2', 'opt2');
    newselect.options[0].selected = true;
    newcell.appendChild(newselect);
    
    //alert(newrow.innerHTML);
    $('#table > tbody > tr').eq(2).after(newrow);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a form with a table source, the form has a few fields
I have a form with the fields inside table cells. On the last column
I have this form:- <form action=> <table border=0> <td colspan=2 class=instruction>Select your desired option
I have this login form. This form is a grouped table view where the
I have a table body that grabs it's rows (and form fields) via AJAX
I have a form that sends info into a database table. I have it
I have a table (in a form) populated with radio buttons (with a button
I have a table let's say in the form of: match(id, hometeam_id, awayteam_id) and
I have a Tabular type Form based upon a SELECT * FROM table type
I have a div inside of a table which is inside of a form

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.