Php 如何将联系人表单7字段添加到我的自定义HTML代码中,如下面的屏幕截图所示?

Php 如何将联系人表单7字段添加到我的自定义HTML代码中,如下面的屏幕截图所示?,php,html,css,wordpress,contact-form-7,Php,Html,Css,Wordpress,Contact Form 7,我想用wordpress contact form 7创建相同的html样式,我只需要使该设计在wcf 7中起作用 还有我的示例html代码: <div class="form-group"> <label>Destination(s)</label> <ul class="tags">Fes</ul> <ul class="tags">Hight Atlas Mountains</ul>

我想用wordpress contact form 7创建相同的html样式,我只需要使该设计在wcf 7中起作用

还有我的示例html代码:

<div class="form-group">
    <label>Destination(s)</label>
    <ul class="tags">Fes</ul>
    <ul class="tags">Hight Atlas Mountains</ul>
    <ul class="tags">Marrakech</ul>
    <div class="destinations-wrap">
        <input type="text" class="form-control icon icon-location" name="locations_search" placeholder="e.g. Iceland"
            autocomplete="false">
        <input type="text" class="destinations-suggestion" disabled>
    </div>
    <button class="btn btn-primary destinations-wrap-btn" tabindex="-1">+ Add Another</button>
</div>

这是使用bootstrap 4的解决方案

HTML

您可以在此处编辑或预览代码

您只能使用html和纯javascript。大声说出我的密码

<!DOCTYPE html>
<html>
<head>
    <title></title>
    <link rel="stylesheet" type="text/css" href="foundlose/vendor/meotip/style.css">
    <meta charset="UTF-8">
    <style type="text/css">

*{
    font-family: "Raleway";
}
span{
    margin-right: 10px;
    margin-bottom: 10px;
    padding: 5px 15px;
    background-color: #E13547;
    color:#FAFAFA;
    font-weight: bold;
    display:inline-block;
    cursor: pointer;
}
#destination-list{
    padding: 5px;
}

    </style>
</head>
<body>
<div class="container">
    <div class="indef">
        <h1>Travel Information</h1>
        <h6>Destiantion(s)</h6>
    </div>
    <div id="destination-list">

    </div>
    <div class="indef">
        <input type="text" name="" id="destination-input">
    </div>
    <div class="indef">
        <button id="add">Add</button>
    </div>
</div>
<script type="text/javascript">

    var destinationList = document.getElementById('destination-list'),

    destinationInput = document.getElementById('destination-input'),

    add = document.getElementById('add');

    add.onclick = function(){

        var addInput = document.createElement('span'), list = destinationList.getElementsByTagName('span');

        addInput.setAttribute("class",destinationInput.value);

        addInput.textContent = destinationInput.value + " ❌";

        destinationList.appendChild(addInput);

        for(var i = 0; i < list.length; i++){

            list[i].onclick = function(){

                this.parentNode.removeChild(this);

            }

        }

    }

</script>

</body>
</html>

如果你尝试了,请在这里分享你的html代码。我只需再次添加我的代码@KiranMistryHello。大约10天前,你问了类似的问题,得到了两个答案,其中一个是我的答案,另一个是你接受的答案。这些解决方案对你不合适吗?JustCuriousHello@inputforcolor,它们工作得很好,但我不知道在这种情况下,当我单击按钮添加另一个+时,如何创建一个文本作为标记标签,您只需要按钮的设计吗?或者您正在寻找javascript的功能,以便在单击按钮时表单添加另一个选项卡?将我的问题的答案添加到你的问题帖子中是个好主意;谢谢你,但我看不到联系人表单7短代码字段?谢谢你,但我看不到联系人表单7短代码字段或它们包含在javascript代码中?不,它与javascript代码分开。你是说wordpress插件吗?我在开玩笑:D。我认为,把纯代码和插件混合起来有点困难,你可以添加静态页面,然后粘贴代码,因为其他主题的你可以使用引导模板。
.badge-secondary{
  border-radius: 0px;
  font-size: 15px;
}

.form-control{
  border-radius: 0px;
  height: 50px
}

.btn-orange{
  background-color: #d17841;
  margin-top: 5px;
  color: white;
}


.search { position: relative; }
.search input { text-indent: 30px;}
.search .fa-map-marker { 
  position: absolute;
  top: 10px;
  left: 20px;
  font-size: 25px;
  color: #8e8e8e;
}
<!DOCTYPE html>
<html>
<head>
    <title></title>
    <link rel="stylesheet" type="text/css" href="foundlose/vendor/meotip/style.css">
    <meta charset="UTF-8">
    <style type="text/css">

*{
    font-family: "Raleway";
}
span{
    margin-right: 10px;
    margin-bottom: 10px;
    padding: 5px 15px;
    background-color: #E13547;
    color:#FAFAFA;
    font-weight: bold;
    display:inline-block;
    cursor: pointer;
}
#destination-list{
    padding: 5px;
}

    </style>
</head>
<body>
<div class="container">
    <div class="indef">
        <h1>Travel Information</h1>
        <h6>Destiantion(s)</h6>
    </div>
    <div id="destination-list">

    </div>
    <div class="indef">
        <input type="text" name="" id="destination-input">
    </div>
    <div class="indef">
        <button id="add">Add</button>
    </div>
</div>
<script type="text/javascript">

    var destinationList = document.getElementById('destination-list'),

    destinationInput = document.getElementById('destination-input'),

    add = document.getElementById('add');

    add.onclick = function(){

        var addInput = document.createElement('span'), list = destinationList.getElementsByTagName('span');

        addInput.setAttribute("class",destinationInput.value);

        addInput.textContent = destinationInput.value + " ❌";

        destinationList.appendChild(addInput);

        for(var i = 0; i < list.length; i++){

            list[i].onclick = function(){

                this.parentNode.removeChild(this);

            }

        }

    }

</script>

</body>
</html>