我试过 $('#tresc_area').val() 但它没有用(不知道为什么)。输入正确发送信息,但 textarea 有问题。请帮我。
<form method="post">
<input class="input" type="text" name="do_kogo" id="odbiorca" size="25" value="<?php print $odbiorca; ?>" />
<input class="input" id="temat" type="text" name="temat" size="25" value="<?php print $temat; ?>"/>
<textarea id="tresc_area" cols="45" rows="10" ></textarea>
<input onclick="Check()" id="send_submit" type="submit" value="Send" />
</form>
这是ajax。当我输入 tresc: "content" 时它会正确发送 "content" 但是当我尝试输入之前声明的 tresc.value 时,我们可以看到它有问题,即使我在那里声明 "$('#tresc_area' ).val()" 有什么建议吗?请帮我
<script type="text/javascript">
var odbiorca = document.getElementById("odbiorca");
var temat = document.getElementById("temat");
var tresc = document.getElementById("tresc_area");
function Check() {
$.ajax({
type: "POST",
url: "send_prv_msg.php",
data: {
do_kogo: odbiorca.value,
temat: temat.value,
tresc: tresc.value
},
success: function(odp) {
$("p#error_box").html(odp);
}
});
}
</script>
tresc: tresc.value <-- 它不起作用。有人知道如何使它工作吗?请