i am trying to update a div and a textarea using a submit button…
the div will be used to show to the user what he’s doing and the textarea to submit through a form
my code looks like this:
$("#newstuff").click(function() {
if ($("#newdrugname").val() !== "") {
var newline = "something: " + var1 + ": " + var2 + ", " + var3 + " text " + var4 + " " + var5;
var tildenewline = "~" + newline;
$("<li/>").text(tildenewline).prependTo("#displaystuff");
var updatedlist = $('div#displaystuff').text();
until here it works ok, the problem is below:
$("#submitstuff").text(updatedlist);
}
});
The #submitstufftext area does not get filled with text.
Firebug shows that it does. (text appears between the <textarea></textarea>
but nothing appears on the broswer and nothing gets posted upon submit…
What could i be missing here?
I should point out that it does work some times, and then suddenly stop…
I havent figured out what causes it to work/stop… and it drives me mad
Any ideas/tips would be greatly apreciated
here’s the HTML:
<div class="displaystuff" id="displaystuff"></div>
<textarea id="submitstuff" name="submitstuff" class="hidden2" style="width:100%"></textarea>
To change
textareavalue use.val():docs: