$('#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<-動作しません。誰かがそれを機能させる方法を知っていますか?お願いします