Submit Multiple Forms With One Button

后端 未结 4 1934
一个人的身影
一个人的身影 2020-12-02 00:31

I am using $_SESSION to dynamically create forms for my web store. These forms hold the custom info for the product that the customer wants. This is the layout:

4条回答
  •  渐次进展
    2020-12-02 01:20

    Have you tried to do it with $.ajax? You can add an foreach, or call another form on the Onsucces function. Another approach is changing all to one form with an array that points to the right "abstract" form:

    And in php:

    foreach ($_POST['name'] as $key => $value) {
        $_POST['name'][$key]; // make something with it
        $_POST['example'][$key];  // it will get the same index $key
    }
    

提交回复
热议问题