私は長い間試してきましたが、問題を見つけることができません。
getelementbyId は、最初の 2 つの ID: 'odbiorca' と 'temat' からデータを正しく取得し、データベースに正しく追加しますが、テキストエリア 'tresc' の場合は発生しません。
誰か助けてくれませんか?
<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があります
<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>
誰かが理由odbiorca.value
を知っていてtemat.value
、正しく動作しますが、そうでtresc.value
はありませんか?