My jquery doesn't see <textarea>
Hi everyone.
I have a javascript + php document which have to send mistakes, which users found on the website. I need to make it on jquery + ajax. My jqeury see the data like id user and mistake url but it doesn't see the text message. Empty data both on jquery and ajax. So i can't understand why it doesn't see the text variable.
Check the code, please.
<textarea id="say_error" class="error" name="say_error" rows="10" cols="45"></textarea>
<input type="hidden" name="urlsw" value="<?php echo $_SERVER['REQUEST_URI'];?>"/>
<div id="center"><input type="button" name="send_text_error" id="send_text_error" value="Send"/></div>
<script>
$(document).ready(function(){
var url = $("input[name=urlsw]").val();
var user = <?php echo $_SESSION['id_user'] ?>;
var text = $(".error").val();
$("#send_text_error").click(function(){
alert(text);
alert(data);
});
});
});
</script>