Good morning. The problem: there is a Javascript
+ HTML
form for sending errors found on the site. You need to do it through AJAX
(without reloading the page). The problem is that jQuery
and AJAX do not see the error text in the textarea
element. That is, all the data from the ajax-oops input is sent to the file handler, but the textress does not want + tried to output its contents via alert ()
- nothing is output. Help to understand 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="Отправить"/></div> $(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); $.post("http://zoobonus.com/error_ajax.php", {user: user, link: url, text: text}, function(data) { alert(data); }); }); });
It sees and transfers the variables url and user, but not the text variable. What is the problem?