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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T18:39:22+00:00 2026-06-10T18:39:22+00:00

I have an admin page where I add and delete table rows on the

  • 0

I have an admin page where I add and delete table rows on the fly.
The page comes loaded with the existent data in the database (mostly consisting in a sku_code and 5 different prices) but when I add rows on the fly, and fill them with the corresponding skus and prices, I want to save them as well in the database.

The problem is that what I do on the client-side with Javascript (add table rows on the fly) with innerHTML = '<input type="text"> is not accesible via $_POST variables of the main <form>

So basically i add via Javascript ‘s so i can fill them and save them as well in the database. But the $_POST values are empty.
Javascript code works fine. I have no clue where should i start debugging.

here’s some Javascript code i’m using

function insert_record(){

    var my_table = document.getElementById('my_table')
    var tr = my_table.insertRow(my_table.rows.length-1)
    //id-ul curent, numar toate row-urile - 1 (care este butonul OK)

    var c_id = my_table.rows.length-2

        tr.id = 'row_' + c_id + ''
    var tr_td_1 = tr.insertCell(0)
        tr_td_1.className = 'text2'
        tr_td_1.align = 'center'
        tr_td_1.innerHTML = 'SKU'
    var tr_td_2 = tr.insertCell(1)  
        tr_td_2.className = 'text3'
        tr_td_2.width = '63'
        tr_td_2.innerHTML = '<input name="sku_' + c_id + '" type="text" id="sku_' + c_id + '" size="33" value="">'

….this addes a inside the table just before the last which contains the submit button, after which there’s the

  • 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-10T18:39:24+00:00Added an answer on June 10, 2026 at 6:39 pm

    You need to assign a label to element. Then you can grab it in next page.

    Instead of innerHTML = <input type="text"> try to use

    <script>
          function addElement(tag_type, target, parameters) {
            //Create element
            var newElement = document.createElement(tag_type);
    
            //Add parameters
            if (typeof parameters != 'undefined') {
              for (parameter_name in parameters) {
                newElement.setAttribute(parameter_name, parameters[parameter_name]);
              }
            }
    
            //Append element to target
            document.getElementById(target).appendChild(newElement);
          }
        </script>
    

    You can call this function below either click of even or manually addElement('INPUT','targetTag',{id:'my_input_tag', name:'my_input_tag', type:'text', size:'5'});

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

Sidebar

Related Questions

On initial page load, my data gets loaded fine. I have a delete function
I have folders and pages /admin/add/index.php, /admin/edit/index.php & /admin/view/index.php which all are requiring page
On the admin panel of my website, I have a page to add a
Hey guys I have an admin page that checks if you are admin before
I have created a user from openfire admin page. I have entered the username,
I have a path defined: when /the admin home\s?page/ /admin/ I have scenario that
My project is about a school admin I have a page called : createClass.php,
I have a page which basically allows an admin user to create manager user
I have a requirement where the CMS admin will create the content [Article] page
I have a web page, used for admin purposes, which runs a task (image

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.