我将如何将项目拖放到表单变量并通过电子邮件发送

How would i go about saving drag and drop items to a form variable and sending it through email?

本文关键字:变量 电子邮件 表单 项目 拖放      更新时间:2023-09-26

这是设置: http://sawhost.com/saw/demo.html

我希望

访问者将 6 本杂志拖放到顶部的框中,当他们点击提交时,我希望至少将每个杂志图像的标题属性添加到表单元素或其他东西中......

我在表单上有一个隐藏的文本区域准备接收,但我确定这是一小部分代码,我忽略了它无法使其工作。 这是我到目前为止拥有的JavaScript的副本。

function checkEmail(myForm) {
  var coices = new Array();
  var input = "";
  choice[0] = document.getElementById("box12").innerHTML + "<br />";
  choice[1] = document.getElementById("box102").innerHTML + "<br />";
  choice[2] = document.getElementById("box103").innerHTML + "<br />";
  choice[3] = document.getElementById("box104").innerHTML + "<br />";
  choice[4] = document.getElementById("box105").innerHTML + "<br />";
  choice[5] = document.getElementById("box106").innerHTML + "<br />";
  for (var i = 0; i < 6; i++) {
    input += choice[i];
  }
  myForm.list.value = input;
  return (true);
}

试试这个:

function checkEmail(myForm) {
    var choice = [],
        input  = '', i;
    for (i = 0; i < 6; i++) {
        input += document.getElementById("box10" + (i+1)).getElementsByTagName('img')[0].title + '<br />';
    }
    myForm.list.value = input;
    return true;
}