Jump to content

Recommended Posts

Hello Folks,

 

I hope this post won't be a duplicate or have any other annoyances to you seasoned members, but it's my first here so be gentle :). Anyhow, I have  a site which I'm developing that follows your basic PHP/HTML structure: HTML start, PHP to process form logic and access the DB, and the form itself. I'm trying to implement a button on the form that will allow users to add another input section (a group of input boxes) to the bottom of the form so that they can add more items to their query. I couldn't figure out how to do this in PHP, so I tried with Javascript. Got it to work for adding generic form elements, but the problem is this: The original form elements (which I essentially want to duplicate at the bottom of the form) are constructed by a PHP for loop on page load (they're <select> menus that are filled with entries from the DB). I can' figure out how I can get the same elements with the same data to load onto the page dynamically with new id's so they're unique.

 

Any guidance on this matter would be greatly appreciated. Thanks!

Link to comment
https://forums.phpfreaks.com/topic/200598-dynamic-form-elements-wphp/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.