Skip to content
Advertisement

PHP how to send and receive multiple choice box

I need suggestion. I have an list of position from database, displayed in table and in the last table row is an option to select “TAK” – YES and “NIE” – NO, please tell me is it possible and if it, how to send and receive it all selected to “TAK” fields at file wypozyczalnia.php

JavaScript

Advertisement

Answer

At the moment you have multiple forms – one per table row, so each <select is inside its own form. You can’t submit multiple forms at once from a HTML page. Also your existing forms seem to be missing the </form> tag so they will be invalid anyway.

Therefore, to be able to submit all the <select values at the same time, you need a single form, which has the entire table contained within it.

For example:

JavaScript

P.S. A note about HTML semantics: <th> is mean to indicate a table heading, e.g. the title of a column, or the main heading within a row. It should not be used for every cell in your table. <td> is for normal table cells. If you wish to make the text bold, use CSS instead.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement