\u8acb\u7a0d\u7b49<\/div>\n
\n
![](\"https:\/\/cdn.bnextmedia.com.tw\/assets\/bnextmedia\/circled-right.gif\")
\n <\/div>\n <\/div>\n<\/div>\n<\/div>\n","output":"633c519b5cba7","form":"frm-id-2631-7103"};
var dom = null;
if(json.output !== '') {
dom = document.getElementById(json.output);
if(dom === null) {
var nd = document.createElement("div");
nd.id = json.output;
nd.className = "edm-form-panel";
document.body.append(nd);
dom = nd;
}
}
if(dom === null) {
return;
}
var pt = document.createElement("div");
pt.className = "edm-form-area";
pt.innerHTML = json.html;
dom.append(pt);
var form = document.getElementById(json.form);
var picklist = form.querySelector(".picklist");
var inputemail = form.querySelector(".email-input");
var url = form.dataset.url;
var elements = form.getElementsByClassName("form-item");
var overlay = pt.querySelector(".overlay");
var warning = pt.querySelector(".warning");
var warning_text = pt.querySelector(".warning .msg");
var thankyou = pt.querySelector(".thankyou");
var timer = null;
var process = false;
var edm_ids = [];
if(inputemail) {
inputemail.addEventListener('keyup',function(e){
var ck = (''+inputemail.value).trim();
if(ck && ck.length > 0){
var last = ck.slice(-1);
if(last === "@") {
picklist.style.display = "block";
return;
}
}
picklist.style.display = "none";
});
}
var items = picklist.querySelectorAll(".emils");
if(items) {
for (let i = 0; i < items.length; i++) {
items[i].addEventListener("click", function(e) {
var text = e.target.innerText;
var org = inputemail.value;
var arr = org.split("@");
inputemail.value = arr[0]+'@'+text;
picklist.style.display = "none"
});
}
}
form.addEventListener('submit',function(e){
e.preventDefault();
if(process) {
return false;
}
form.classList.toggle("processing");
var formData = new FormData();
var map = {};
edm_ids = [];
for(var i=0; i