Jump to content

Duplicating Fields


verdrm

Recommended Posts

Well, you are asking two questions.

 

Concerning adding a field, do you want to have a page refresh when the user clicks the plus sign? I would assume no since if you were going to submit the page you might as well add the first entry to the database and then show a new form. If that is the case, then you need to utilize javascript to dynamically add the field. I have a script at work which does exactly that.

 

I would suggest naming all the text fields the same in an array format:

<input type="text" name="datafield[]">

 

Then when the page is posted you can iterate through all of the datafield elements and save to the database.

Link to comment
https://forums.phpfreaks.com/topic/67410-duplicating-fields/#findComment-338419
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.