Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/404.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/267.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript PHP/JQuery和HTML如何提交多个克隆表单_Javascript_Php_Jquery_Html_Forms - Fatal编程技术网

Javascript PHP/JQuery和HTML如何提交多个克隆表单

Javascript PHP/JQuery和HTML如何提交多个克隆表单,javascript,php,jquery,html,forms,Javascript,Php,Jquery,Html,Forms,你好,我有这个密码 <script type="text/javascript"> (function($){ $countForms = 1; $('.myForms').submit(function () { console.log(""); return true; }); $(functi

你好,我有这个密码

    <script type="text/javascript">

        (function($){
            $countForms = 1;
            $('.myForms').submit(function () {
                console.log("");
                return true;
            });

            $(function(){
                $("#clickMe").bind("click", function(){
                    $(".myForms").trigger('submit');
                });
            });
            $.fn.addForms = function(){
                var myform =
                    "<fieldset>"+
                    "<form action='' method='POST' enctype='multipart/form-data'  class='myForms'>"+
                    "<label class='label_ga' for='artikel("+$countForms+")'>Omschrijving gewenst artikel:"+
                    "<input class='input_ga' name='artikel["+$countForms+"]'  type='text' value='' size='30'></label><br>"+
                    "<label class='label_be' for='bewerking("+$countForms+")'>Omschrijving gewenste bewerking:"+
                    "<input class='input_be' name='bewerking["+$countForms+"]' type='text' value='' size='30'></label><br>"+
                    "<label class='label_aa' for='aantal("+$countForms+")'>Aantal:"+
                    "<input class='input_aa' name='aantal["+$countForms+"]'  type='text' value='' size='30'></label><br>"+
                    "<label class='label_kl' for='kleur("+$countForms+")'>Kleur:"+
                    "<input class='input_kl' name='kleur["+$countForms+"]'  type='color' value='' size='30'></label><br>"+
                    "<label class='label_op' for='opdruk("+$countForms+")'>soort opdruk:"+
                    "<select class='select_op' name='opdruk["+$countForms+"]'  size=''30>"+
                    "<option>borduren</option>"+
                    "<option>bedrukken</option>"+
                    "<option>voorzien van eigen logo of uitdruking</option>"+
                    "</select></label><br>"+
                    "<label class='label_fi' for='file("+$countForms+")'>Afbeelding:"+
                    "<input class='input_fi' type='file["+$countForms+"]' name='foto'    value=''    size='30'/></label>"+
                    "</form>"+
                    "</fieldset>";

                myform = $(myform);
                $("button", $(myform)).click(function(){ $(this).parent().parent().remove(); });

                $(this).append(myform);
                $countForms++;
            };
        })(jQuery);

        $(function(){
            $("#mybutton").bind("click", function(){
                $("#container").addForms();
            });
        });

    </script>
</head>
<body>
<div id="container">


   <button id="clickMe">send</button>

</div>

<button id="mybutton">Artikel Toevoegen</button>
<input id="mybutton" type="button" value="Artikel Toevoegen" name="add"/>

</body>
</html>
<?php
//if (isset($_POST['submit'])) {
    $count = count($_POST['artikel']);
    echo $count;

foreach ($_POST["artikel"] as $artikel) {
//    echo $artikel;
    print_r($_POST["artikel"]);
}
//}
?>

(函数($){
$countForms=1;
$('.myForms')。提交(函数(){
控制台日志(“”);
返回true;
});
$(函数(){
$(“#单击我”).bind(“单击”,函数(){
$(“.myForms”).trigger('submit');
});
});
$.fn.addForms=函数(){
var myform=
""+
""+
“Omschrijving gewenst artikel:”+
“
”+ “Omschrijving gewenste bewerking:”+ “
”+ “安塔尔:”+ “
”+ “克莱尔:+ “
”+ “soort opdruk:”+ ""+ “博杜伦”+ “贝德鲁肯”+ “uitdruking的voorzien van eigen标志”+ “
”+ “Afbeelding:”+ ""+ ""+ ""; myform=$(myform); $(“按钮”,“$(myform))。单击(函数(){$(this.parent().parent().remove();}); $(this.append(myform); $countForms++; }; })(jQuery); $(函数(){ $(“#我的按钮”).bind(“单击”,函数(){ $(“#容器”).addForms(); }); }); 发送 阿蒂克尔·托沃根
这是一个简短的测试脚本

有人能帮助我,告诉我如何制作一个提交表单的按钮吗。 最后,php代码可以访问表单中的信息,因此我可以通过邮件发送它(我已经准备好了一个表单的代码)


希望有人能帮助我,谢谢

你想同时提交所有表格吗?是的,我需要同时将所有信息发送到电子邮件地址,但该部分在我的其他代码中,它不克隆表格,我会在我有此部分工作时添加该部分什么不工作?您没有对submit进行任何操作以了解它是否正常工作。submit按钮不起作用,因此我对其进行了评论,为什么不提交一个表单并将值收集为如下数组: