I have multiple text boxes and textareas of which I want to add the values to an array.
With the way I am doing it at the moment I do manage to get the values of the text boxes but not the text areas.
How can I retrieve the values of multiple textarea?
<input type="text" name="fields[]"
<input type="text" name="fields[]"
<input type="text" name="fields[]"
<textarea name="areas[]"
<textarea name="areas[]"
<textarea name="areas[]"
This is the Jquery with which I do this.
var fields = [];
$('input[name^=fields]').each(function () {
fields.push($(this).val());
});
var areas = [];
$('input[name^=areas]').each(function () {
areas.push($(this).val());
});
I do manage to get the text box values but not the Multiline values(text area)
How can I do this?