Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/251.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/2/jquery/73.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
Php 使用JQuery Repeater插件后按钮消失_Php_Jquery_Css_Repeater - Fatal编程技术网

Php 使用JQuery Repeater插件后按钮消失

Php 使用JQuery Repeater插件后按钮消失,php,jquery,css,repeater,Php,Jquery,Css,Repeater,我正在尝试使用PHP中的JQuery插件向表单中添加一个repeater字段。但是,一旦我可以调用插件,就会出现以下3个问题 要重复的初始字段不再显示 移除不再显示的按钮 插入文本(提交按钮上的文本)不再显示 在我通过添加到文件夹使插件可以调用之前,这三个插件都显示出来了 这些是截图 这是我的密码 <?php include_once "db.php"; ?> <!doctype html> <html> <

我正在尝试使用PHP中的JQuery插件向表单中添加一个repeater字段。但是,一旦我可以调用插件,就会出现以下3个问题

  • 要重复的初始字段不再显示
  • 移除不再显示的按钮
  • 插入文本(提交按钮上的文本)不再显示
  • 在我通过添加到文件夹使插件可以调用之前,这三个插件都显示出来了

    这些是截图

    这是我的密码

    <?php
        include_once "db.php";
    ?>
    
    
    
    <!doctype html>
    <html>
        <head>
            <meta charset="utf-8">
            <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
            <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
            <title>Add Remove Dynamic HTML Fields using JQuery Plugin in PHP</title>
            <meta name="viewport" content="width=device-width, initial-scale=1">
            <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" />
            <script src="https://code.jquery.com/jquery-1.12.4.min.js" integrity="sha384-nvAa0+6Qg9clwYCGGPpDQLVpLNn0fRaROjHqs13t4Ggj3Ez50XnGQqc/r8MhnRDZ" crossorigin="anonymous"></script>
            <script src="repeater.js" type="text/javascript"></script>
    
        </head>
    <body>
        <div class="container">
            <br />
            <h3 align="center">Add Remove Dynamic HTML Fields using JQuery Plugin in PHP</h3>
            <br />
            <div style="width:100%; max-width: 600px; margin:0 auto;">
                <div class="panel panel-default">
                    <div class="panel-heading">Add Programming Skill Details</div>
                    <div class="panel-body">
                        <span id="success_result"></span>
                        <form method="post" id="repeater_form">
                            <div class="form-group">
                                <label>Enter Programmer Name</label>
                                <input type="text" name="name" id="name" class="form-control" required />
                            </div>
                            <div id="repeater">
                                <div class="repeater-heading" align="right">
                                    <button type="button" class="btn btn-primary repeater-add-btn">Add More Skill</button>
                                </div>
                                <div class="clearfix"></div>
                                <div class="items" data-group="programming_languages">
                                    <div class="item-content">
                                        <div class="form-group">
              <div class="row">
               <div class="col-md-9">
                                                    <label>Select Programming Skill</label>
                                                    <select name="SELECTNAME"> 
                    <?php
                        $SQLSELECT = "SELECT * FROM subject ";
                        $result_set =  mysqli_query($conn, $SQLSELECT);
                        while($row = mysqli_fetch_array($result_set))
                        {
                        ?>
         
                            <tr>
                            
      <option value="<?php echo $row['EMAIL']; ?>"><?php echo $row['NAME']; ?></option>
                             
         
                            </tr>
                        <?php
                        }
                    ?>
                </table>
                                                </div>
                                                <div class="col-md-3" style="margin-top:24px;" align="center">
                                                    <button id="remove-btn" class="btn btn-danger" onclick="$(this).parents('.items').remove()">Remove</button>
                                                </div>
              </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
          
          <div class="clearfix"></div>
                            <div class="form-group" align="center">
           <br /><br />
                                <input type="submit" name="insert" class="btn btn-success" value="insert" />
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
        
        <script>
        $(document).ready(function(){
    
            $("#repeater").createRepeater();
    
            $('#repeater_form').on('submit', function(event){
                event.preventDefault();
                $.ajax({
                    url:"insert.php",
                    method:"POST",
                    data:$(this).serialize(),
                    success:function(data)
                    {
                        $('#repeater_form')[0].reset();
                        $("#repeater").createRepeater();
                        $('#success_result').html(data);
                        /*setInterval(function(){
                            location.reload();
                        }, 3000);*/
                    }
                });
            });
    
        });
            
        </script>
        </body>
    </html>
    
    
    
    
    
    在PHP中使用JQuery插件添加或删除动态HTML字段
    
    在PHP中使用JQuery插件添加或删除动态HTML字段
    添加编程技能细节 输入程序员名称 增加更多技能 选择编程技能 去除

    $(文档).ready(函数(){ $(“#repeater”).createRepeater(); $('#repeater_form')。在('submit',函数(事件){ event.preventDefault(); $.ajax({ url:“insert.php”, 方法:“张贴”, 数据:$(this).serialize(), 成功:功能(数据) { $('#中继器形式')[0]。重置(); $(“#repeater”).createRepeater(); $('success_result').html(数据); /*setInterval(函数(){ location.reload(); }, 3000);*/ } }); }); });