小编ndw*_*ner的帖子

提交表单时,使用 JavaScript 创建的表单元素不会在 php 中使用 $_POST

总体概述:

我有三个 php 页面:

  • 一个是数据输入页面,它有一个文本字段,onkeydown 会更改 iFrame 的 URL,
  • iFrame中包含一个网页,搜索电子邮件地址的LDAP和MySQL数据库。当点击搜索结果时,它会将禁用的文本输入添加到数据输入页面。
  • 并且有一个接收表单信息并发送电子邮件的操作页面

问题是没有任何表单数据从静态表单元素或由 JavaScript 创建的动态表单元素传递到操作页面。

表单.php

<SCRIPT type="text/javascript">
// <!--

function delRecipient(object) {
    var answer = window.confirm("Remove recipient?")
    if (answer){
        countChildren = object.parentNode.parentNode.childNodes.length;
        oldName = "recipient" + countChildren;
        newName = object.parentNode.id;
        object.parentNode.parentNode.removeChild(object.parentNode);
        document.getElementById(oldName).id = newName;
    }
}

function iFrameHeight(id) {
  var content_height=document.getElementById(id).contentWindow.document.body.scrollHeight;
  document.getElementById(id).height=content_height;
  document.getElementById(id).style.display='block';
}

function iFrameOpen(id) {
    document.getElementById(id).style.display='block';
    iFrameHeight(id);
}

function iFrameClose(id) {
    var dt = new Date();
    while ((new Date()) - dt …
Run Code Online (Sandbox Code Playgroud)

javascript php forms

3
推荐指数
1
解决办法
1270
查看次数

标签 统计

forms ×1

javascript ×1

php ×1