我想将 textarea 数据发布到 php 表单并将其响应返回到另一个 textarea。你们能告诉我这是怎么做到的吗?我试过跟随但它不起作用!
$.post(url, dataToBeSent, function(data, textStatus) {
url="./doit.php";
var dataToBeSent = $("myform").serialize();
var siteContents2 = data.contents;
document.myform2.outputtext2.value = siteContents2 ;
}, "json");
形式:
<form id="myform" name="myform" action="./ok1.php?Id=&title=" method="post">
<td><textarea rows="7" cols="15" name="outputtext" style="width: 99%;"></textarea></td>
</form>
<form id="myform2" name="myform2" action="./ok2.php?Id=&title=" method="post">
<td><textarea rows="7" cols="15" name="outputtext2" style="width: 99%;"></textarea></td>
</form>
php 获取传递的数据 beg getjson:
$passed3 = $_post['dataToBeSent'];
echo $passed3;