Hi all,
I'm having a bit of trouble processing a dynamic expenses form.
In the form I have 2 buttons that increment the number of form fields in 2 different places on the page.
I named the form elements according to the table field in the database.
If the form field is multiplied (clicking the add form field button), I add an auto_increment number for the id with javascript:
txtData1 ->(original form element)
txtData2 ->(created dynamically)
txtData3 ->(created dynamically)
txtData4 ->(created dynamically)
etc
When processing the form, I know I can get the formfield names and values using:
Code PHP:foreach ($_POST as $key => $value) { echo $key ."->". $value."<br>"; }
But I need to collect groups of information (form fields) from the page and insert into a expenses database.
So the majority of the fields will go into one table, but other will go into another.
How can I differentiate the necessary keys and build the query?
Hope I explained my self right...
Thanks in advance.




Bookmarks