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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T01:04:20+00:00 2026-05-11T01:04:20+00:00

I have a product registration form that allows the user to add additional product

  • 0

I have a product registration form that allows the user to add additional product fields by clicking ‘add product’. When the user clicks add product, Javascript creates new product field in an existing div.

I currently allow up to 10 products to be added on the form, so I setup a div structure like this:

<div id='product1'></div> <div id='product2'></div> <div id='product3'></div> etc... 

I have one empty div for each product box that may be added by the user. I use Javascript’s innerHTML method to populate the divs.

On to my question: How can I allow an unlimited number of products to be added at once? Obviously, my current setup won’t support this since I need to hard code separate div’s for each potential product so Javascript has a specific place to drop more data.

NOTE: Before someone suggests using a single div and appending new data into it, that doesn’t work. Sadly, all data entered in previous fields is cleared whenever another field is added to the div by appending data like this:

document.getElementById('product').innerHTML += <input name='product'>  
  • 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. 2026-05-11T01:04:21+00:00Added an answer on May 11, 2026 at 1:04 am

    You can dynamically add more DIVs easily. I use Prototype:

    $('someContainerDiv').insert(new Element('div', { id: 'product_'+prodId, 'class':'prod' })) 

    Then put your contents in $('product_'+prodId).innerHTML.

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

Sidebar

Related Questions

I have a product setup executable that copies some files to the user's hard
I'm working on a simple mobile site that have a registration form for Interest,
I have a product in mind that requires the development of a website that
I'm writing a commercial product which uses a simple registration mechanism and allows the
I have product that the product serial number equals product series, chip, model, manufacture,
I have product name(in paragraph), text form and button. The products have id's as
I have a process that imports a daily file of product registrations, and adds
I have product models that look like: EF 200 That appear in paragraphs of
I have the following scenario to implement: there is the product registration, but this
We have Product Backlog in an Excel Spreadsheet that we also commit to SVN,

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.