New lines from JavaScript
Posted: Thu Jun 19, 2008 1:31 pm
I am using a GET to get the value from a text area. I want to keep the newlines/carriage returns since this is basically a notepad function. For some reason, I'm not keeping/transforming the new lines. My AJAX response is simply all one line. FYI, I did an alert from my javascript function to verify that the new lines are being sent.
Code: Select all
$bullet_pad = nl2br($_GET["pad"]);
$what = addslashes($_GET["what"]);
$thisMonth = date("m");
if($this_em_id == $em_id)
{
if ($what == 1)
{
echo "<h1>Final Draft</h1>";
$current_bullet_q = "SELECT bullet_pad FROM " . _t_bullets . " WHERE month='$thisMonth' and em_id='$this_em_id'";
$current_bullet = $db->get_var($current_bullet_q);
echo nl2br($current_bullet);
echo "<br />";
echo nl2br($bullet_pad);
}
}