Here's my goal: Loop through Textareas that are children of a div, retrieve their texts and .push into an array.
Problem: After I make a change to the text in the textarea and click "save", it loops through the textareas and retrieves the data that was in there to begin with. Not the new data I enetered.
Can anyone explain this behaviour?
here is my code:
$("#update_info").click(function () {
var arr_i = new Array();
$("#class_assignments i").each(function (index) {
arr_i.push($(this).text());
});
$("#class_assignments textarea").each(function (index) {
alert($(this).text()); // This alert is showing me the old data. I want to change & save this to DB
$.post("update_info.php", {
u_asmt: arr_i[index],
u_info: $(this).text()
}, function (output) {
alert(output);
});
});
});
Anyone have any suggestions?

New Topic/Question
Reply


MultiQuote


|