View Full Version : is it possible to clone a form field to database

02-06-2012, 01:37 AM
Hi what I am trying to achieve is:

User inputs to form - name, contact, email, machine model, machine serial
Now if they have more than one machine to insert (could be 15 or more) then I am trying to allow then to click and clone those 2 fields machine model, machine serial and it goes into the database.
Is it possible for mysql to clone these fields?

02-06-2012, 03:41 AM
im having problems understanding what you mean by clone .
do you mean multiple values?

02-06-2012, 04:06 AM
Hi edbr
You have a database 2 fields for your form:

The form has both those fields but if a user wants to add another machine e.g. like you can using javascript:

but the results need to go into the mysql database.

02-06-2012, 07:51 AM
you dont have database field on a form
. i would say looking that each time you add a field in your form it will be renamed machine_model if cloned it will take a new name ie machine_model01 machin_serial becomes machin_serial01.

so you will need to import into existing database fields

however if not you maybe able to collect the info as an array, and then insert that into a a database seperated with commas ,slashses or what you will. that would be a better senario , you will have to see what options you have in the jquery script