Hi, ive been trying to use the function below to update the content of a form textarea with some php that goes and gets some text thats in a field in mysql (changes the content when a dropdown list for year is changed so it shows anything that is already entered for that year so it can be edited easily).
But ive run into a problem, it only seems to return the text in the mysql field before a line break, anything after isnt returned into the textarea (it actually returns nothing if the text spans multiple lines). I have echo’d the php query and that does return all the data in the field though.
[CODE]var content=new Array(
“<?php query1 ?>”,
“<?php query2 ?>”,
“<?php query3 ?>”,
“<?php query4 ?>.”
);
function update(){
document.getElementById(“FieldName”).value=content[document.getElementById(“year”).value];
Dropdown:
[CODE] <select name=”year” id=”year” onchange=”update();”>
<option value = “0” > – </option>
<option value = “3” > 2011 </option>
<option value = “2” > 2010 </option>
<option value = “1” > 2009 </option>
Is there a limit to how many lines the above function can return, or is there an alternative to returning a value to a textarea that spans multiple lines?
Many thanks