前端  a.html
<div id="job_info_two">
<table width="100%" border="1">
  <tr>
    <td height="25"><font color="#FF0000">*</font>&nbsp;专业</td>
    <td align="center"><input type="text" name="job_major_one" id="job_major_one" size="50" onblur="check_major();"/></td>
  </tr>
  <tr>
    <td>专业描述</td>
   <td align="center"><textarea cols="100" rows="15" name="job_Professional_description_one" id="job_Professional_description_one"></textarea></td>
  </tr>
</table>
</div>
<br />
<span id="add_education" style="color:#FF0000;font-size:16px;" onclick="add_education();"><u><b>继续添加</b></u></span>当我单击继续添加会在下面出现一个新的table,用到表克隆。代码如下
function add_education(){
var div_id=document.getElementById("job_info_two");
var content=div_id.children[0].cloneNode(true);
div_id.appendChild(content);
}问题:请问如何在php中获取原来表的内容和克隆后表的内容。就是获取添加后所有表的内容,在a.php文件中如何获得,求大神帮忙jsjavascriptphp

解决方案 »

  1.   

    在外层加入一个form表单和提交按钮,form 的 action='a.php' 
      

  2.   

    <?php
    $arr = $_POST["job_major_one"];
    if(is_array($arr)){
       foreach($arr as $v2){
        echo "$v2<br>";
    }
    }
    ?>
    <form action="?" method="post">
    <div id="job_info_two">
        <table width="100%" border="1">
            <tr>
                <td height="25"><font color="#FF0000">*</font>&nbsp;专业</td>
                <td align="center"><input type="text" name="job_major_one[]" size="50" onblur="check_major();"/></td>
            </tr>
            <tr>
                <td>专业描述</td>
                <td align="center"><textarea cols="100" rows="15" name="job_Professional_description_one[]"></textarea></td>
            </tr>
        </table>
    </div>
        <span id="add_education" style="color:#FF0000;font-size:16px;" onclick="add_education();"><u><b>继续添加</b></u></span>
        <input type="submit" value="提交">
    </form>
    <script type="text/javascript">
    function add_education(){
        var div_id=document.getElementById("job_info_two");
        var content=div_id.children[0].cloneNode(true);
        div_id.appendChild(content);
    }
    </script>