Good day all:
I've been experiencing a great difficulty resolving a problem concerning replacing
<br/>
to an actual newline inside a textarea box. Much of the problem has been because the data in the textarea is populated via a php script in this manner:
echo "formObj.servicedesc.value = '".toSafeString($inf["servicedesc"])."';\n";
Inside my textarea box I get the following:
<textarea><br/>On 12/01/10 @ 09:51<br/>We performed the following:<br/>
information update<br/><br/>----End of Service Report----<br/><br/>On 12/01/10 @ 09:43<br/>We performed the following:<br/>
information update<br/><br/>----End of Service Report----<br/><br/>On 11/29/10 @ 11:55<br/>We performed the following:<br/>
Information update<br/><br/>----End of Service Report----<br/><br/>On 11/29/10 @ 04:41<br/>We performed the following:<br/>
information update<br/><br/>----End of Service Report----<br/><br/>On 11/25/10 @ 09:34<br/>We performed the following:<br/>
Information updateds<br/><br/>----End of Service Report----<br/><br/>On 11/25/10 @ 08:56<br/>We performed the following:<br/>
We are performing an oil change<br/>Changing new brakes<br/>New tires<br/><br/>----End of Service Report----<br/>On 11/24/10 @ 09:43<br/>We performed the following:<br/>
3Click here to add details of todays service<br/><br/>----End of Service Report----<br/><br/>On 11/24/10 @ 09:15<br/>We performed the following:<br/>
<br/>On 11/22/10 @ 02:24<br/>We performed the following:<br/>
Click here to add details of todays serviced<br/><br/>----End of Service Report----<br/></textarea>";
Whereas, my ideal outcome is:
On 12/01/10 @ 09:51
We performed the following:
information update
----End of Service Report----
On 12/01/10 @ 09:43
We performed the following:
information update
----End of Service Report----
On 11/29/10 @ 11:55
We performed the following:
Information update
----End of Service Report----
My textarea box is written in html as follows:
<textarea name="servicedesc" id="servicedesc" cols=60 rows=12 disabled="true" style="position: absolute; right: 13; top: 260">
I have used numerous preg_replace functions but unable to resolve. I'm think I may be placing it incorrectly.
Any assistance with is greatly appreciated!
Mossa