Adding multiple PHP commands and records on a single HTML5 Bootstrap submit modal
20:09 05 May 2026

I am attempting to replace an existing perl webapp with Bootstrap and PHP, but running into problems on multiple forms posting.

I have a form for adding a "host group" and then populate a dropdown box from a list of hosts from a SQL database, each time a host is selected it is added to a hidden table for action. So I need multiple PHP commands, one to add the initial host group record and then a second series for each host group to host combination in the hidden table. (Naturally I need the database record ID of the master "host group" record to add to the second table for 'host-group-to-host' mapping).

I can't use a conventional POST form with PHP, and I have tried using the following format but the initial php submit works but any subsequent submits do not (it opens the modal, accepts the data but then does nothing, I have to press "F5" to perform a full refresh before it will add another entry).

Here is some of the sample form and the code.

        

and this is the jquery code.


I am thinking that the POST is too simplistic for the type of control I need, so do I need to write my own POST / modal handler code inside a button rather than rely on the native HTML posting?

Regards, Robert

php html jquery post