1

I am trying to use a form to post multiple of the same object in PHP, but I can't get my head around a decent approach. Being a C# Developer, I would have my controller take in a List, but with PHP I can't work out quite how to do it.

Example form

Person: Anne Frank
Subject: English
Grade: A

Person: Steven Seagull
Subject: Maths
Grade: C

Person: Jeff Banks
Subject: English
Grade: F


Essentially I have a list, which has a select list, and a free text field, I want to be able to update and insert into the database with one submit.

Any suggestions for how I can approach this?

Harambe
  • 997
  • 2
  • 8
  • 17
  • 1
    This might help: https://stackoverflow.com/questions/3314567/how-to-get-form-input-array-into-php-array – Nick Aug 14 '18 at 08:59
  • In javascript use json format to get all the selected values and put it in your text field. Then you can submit the field value. – Viswanath Polaki Aug 14 '18 at 09:00

0 Answers0