On my detail page edit.php I have a list of records. The user can select records by a checkbox and the number of selected records is not fixed, I mean it can be one record, but also one time 5 or 11 records.
The total list of records can be 3 or 500 records or even more, so I don't want to put this in the form and submit the whole bunch! I looks not an good idea to me.
I try give an idea how I see it like an array
"rec1": {
"value1": "some data"
"value2": "some data"
"value3": "some data"
"value4": "some data"
}
"recn": {
"value1": "some data"
"value2": "some data"
"value3": "some data"
"value4": "some data"
}
}
I have to save these value's as record in certain table. This I have this principle working, simply with the form fields one-value and different number of records.
Now I want to extend this with more data. My question is, I'm looking for an tutorial or example of how do I:
If I press the "Save" button, how can I submit these record value's to the controller to save them?
At the controller site how to pick up the records and extract values to save again?
What is the best way how to do that? application/Json or application/XML or application/x-www-form-urlencoded? Till now I don't when or why is the one or another used?
I hope that someone can help me further and help me out so that I at least get an idea how to solve this.
Best Regards,
Nico
<input name="rec[]" ...>
then all subsequent tasks will be cleaner and easier to process.