Form submit problem

Permabanned
Joined
25 Oct 2004
Posts
9,078
Hiya,

Got a form all set up with the final step allowing someone to either submit the data or addmore.

Add more is intended to allow them to go back to page 1 of the form and fill in the data all again. So if they fill it in 2-3 or 4 times the data is stored 2-3 or 4 times.

Essentially creating an array(form submissions) of arrays(each forms data). Q

Question is, besides submitting the data once, what would be the best way of ensuring that the array of data is kept in tact while allowing them to input data multiple times.

Think of it as a table with rows and columns, form 1 is row 1, by clicking add more, they enter the same data in row 2 etc.

Im stuck so any help would be greatly appreciated.
 
The data itself isnt a table, its a form, with numerous text inputs, checkbox's, radio buttons and textarea's.

I just used a basic comparison of my form = the columns in a table and each form filled out = a row in that table.

If thats what you meant also, any tips or ideas on how that can be done as my javascript knowledge is very limited.
 
How would that translate to php, as i in how would the end result of multiple forms of data appear in php ?

Would it just one big array of data or would it be an array of arrays.

IE.

Array 0 => Array Form 1, Array 1 => Array Form 2 etc
 
Using hidden input boxes wouldnt be a massive drain on resources as a user could potentially input thousands of rows of data, so another method would need to be used.

Im guessing php sessions ?

While i've used sessions already and that works perfectly fine when using an item number in the url, when a user gets to the final page and has the choice to submit the data and finish or add another record, thats where im getting stuck.
 
Last edited:
Im not trying to pre-fill the form data, thats easy enough to do if needed.

What I have is a form which collects multiple details about a product (title, value, description etc).

When a user has filled in the information, they can either Submit the data which is then used to generate a CSV file or they can add another item and repeat the process.

I expect people to be using it to create CSV files with hundreds or thousands of items. For one item I have no problems, thats easy, but when they add another Im not sure how to go about handeling the form data.
 
Back
Top Bottom