发送document.getElementById(“ testtest”)。innerHTML = html;在“邮件”选项卡面板中的“联系表7”

时间:2019-02-22 04:15:21

标签: javascript wordpress contact-form-7

我想制作一个表格,用于通过联系表7中的弹出窗口制造商选择语言技能。我能够使用getElementById("testtest")输入和显示语言技能的结果。如何在“邮件”标签面板的联系表格7中通过电子邮件发送结果?

// js code to call popup maker plugin
if('4397' == event.detail.contactFormId ){
    var style = document.createElement('style');
    style.type = 'text/css';
    style.innerHTML = '.wpcf7-response-output {display: none !important;}';
    document.getElementsByTagName('head')[0].appendChild(style);
    var inputs = event.detail.inputs;   
    arr_language["people"] = peopleObj;
    peopleObj.push({"language":inputs[2].value,"level":inputs[3].value});

    //this code for display result by popup maker
    var html = "<table border='4|4'>";
    for (var i = 0; i < arr_language.people.length; i++) {
        html+="<tr></tr>";
        html+="<td>"+arr_language.people[i].language+"</td>";
        html+="<td>"+arr_language.people[i].level+"</td>";

    }

    html+="</table>";
    document.getElementById("testtest").innerHTML = html;
    console.log(arr_language);
// html part
<td><div id="testtest"></div></td>

0 个答案:

没有答案