javascript - Ajax response with newlines for textarea -


i have problem concerning ajax-request should return string server newlines (\n) fill textarea.

when following javascript, works , shows 2 lines in textarea:

function filltextarea(){ document.getelementbyid('mytextarea').innerhtml = "line1\nline2"; } 

but if value server using ajax, \n treated other characters of string , there's 1 line

function filltextarea() { new ajax.request("/myurl/....",{     asynchronous:true,     evalscripts:true,     onsuccess:function(transport){         document.getelementbyid('mytextarea').innerhtml = transport.responsetext;     } }); } 

does know how deal newlines in responsetext of ajax request?

don't use .innerhtml = "line1\nline2". use .value = "line1\nline2" instead.

value form values. not setting html contents here.


Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -