i have this form and im trying to get the value from the text area. for some reason it doesn\'t want to.
You need to use .val()
for textarea as it is an element and not a wrapper. Try
$('textarea#message').val()
Updated fiddle
You don't need to use textarea#message
var message = $('textarea#message').val();
You can directly use
var message = $('#message').val();
You can directly use
var message = $.trim($("#message").val());
Read more @ Get the Value of TextArea using the jQuery Val () Method
Value of textarea is also taken with val
method:
var message = $('textarea#message').val();
$('textarea#message')
cannot be undefined (if by $
you mean jQuery of course).
$('textarea#message')
may be of length 0 and then $('textarea#message').val()
would be empty that's all
You can also get the value by element's name attribute.
var message = $("#formId textarea[name=message]").val();