jquery value of textarea
- by Elliott
Hi, I have the code below, which sends the value of the textarea and either gets a fail or Successful response, for now I just check if it says "hello".
function postdata()
{
$.ajax({
type: "POST",
dataType: "text",
url: "makepost.php",
data: "post_text=" + $("#post_text").val(),
cache: false,
success: function(reply_text)
{
if (reply_text.indexOf("Successful") >= 0)
{
alert("Post Made");
}
else
{
alert(reply_text);
}
}
});
}
<textarea rows="3" cols="25" id="post_text" ></textarea><br />
<input type="submit" id="post_bttn" value="Post" onclick="postdata(); return false;">
I have also tested just echo'ing out the value of the textarea, and all the time it is jus blank. Although in firebug it shows that I have sent that text.
Any ideas? Thanks :)