I tried $('#tresc_area').val() but it didn't work (don't know why). Inputs are correctly sending the information, but textarea has problem with it. Please help me.
<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>
and here is the ajax. when i enter tresc: "content" then it correctly sends "content" but when i try to enter there tresc.value which is before declared as we can see it has a problems, even if i declare there "$('#tresc_area').val()" any propositions? please help me
<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 <-- it doesn't work. somebody know how to make it work? please