form submit not working

前端 未结 2 379
陌清茗
陌清茗 2021-01-26 17:55

I have a table that prints out all available cameras. It uses a form to change these settings. The problem is that the form only updates the last camera in the entry. In other

2条回答
  •  北恋
    北恋 (楼主)
    2021-01-26 18:34

    It looks like you have multiple HTML elements with the same name. As such, you want to get back an array of values when the form is posted.

    As such, Get $_POST from multiple checkboxes looks like it might be helpful.

    Alternatively, extend oncameraSubmit so that it stores all the data in a hidden input field (not just the id). Then when you update the database, use these hidden fields.

提交回复
热议问题