I am trying to read the content of a textarea, but .val()
does not work for my textarea.
I would be happy, if someone has a solution for me.
Here's my code:
HTML:
<textarea id="details" class="required" rows="5"></textarea>
JS:
$.ajax({
type: "GET",
url: "reserve.php",
data: {
details : $('#details').val(),
...
},
...
});
Thank you!
.val()
works fine in the sense that the actual value of the textarea is returned. Define "not working"? – Grounds<br />
tag - you have to replace\n
with<br />
to preserve the formatting when displaying back in HTML. – Kiloliter