日期:2014-05-16  浏览次数:20444 次

如何在html中取textarea的内容并传到另一个html页的table中!只有10分了!
就是在A.html中点击编辑页面跳转到B.html中,然后在B.html中的textarea中写下内容,绕后提交到A,html中有一个table的cell显示出来,那位老大做过,给点指点!

------解决方案--------------------
楼上说得对,换动态的吧。
如果你非要用静态的,那就用层和表格的值传递吧。这个简单得多。下面是个简单的例子。

<script>
function t() {
document.all.Layer1.style.visibility= "visible ";
document.all.result.value = document.getElementById( "n ").innerText;
}
function c() {
document.all.Layer1.style.visibility= "hidden ";
document.getElementById( "n ").innerText = document.all.result.value;
}
</script>
<style type= "text/css ">
<!--
#Layer1 {
position:absolute;
left:232px;
top:88px;
width:81px;
height:47px;
z-index:1;
border: 1px solid #666666;
}
-->
</style>
<div id= "Layer1 ">
<label> </label>
<table width= "100 " border= "0 " cellspacing= "0 " cellpadding= "0 ">
<tr>
<td> &nbsp; </td>
</tr>
<tr>
<td> <input name= "result " type= "text " id= "result " size= "10 " maxlength= "10 " /> </td>
</tr>
<tr>
<td> <label>
<input name= "submit " type= "button " onclick= "c() " value= "submit "/>
</label> </td>
</tr>
</table>
</div>
<table width= "100 " border= "0 " cellspacing= "0 " cellpadding= "0 ">
<tr>
<td> &nbsp; </td>
</tr>
<tr>
<td id= "n "> 3 </td>
</tr>
<tr>
<td> <label>
<input type= "submit " name= "Submit " value= "edit " onclick= "t() "/>
</label> </td>
</tr>
</table>