The .val() property of an item in jQuery for a doesn\'t seem to work with new lines. I need this function as the text-area is mean
.val()
", $string); return $string; } //sample2 function nl2br2($string) { $string = str_replace(array("\r\n", "\r", "\n"), "\\n", $string); return $string; } echo "$('#txtRisks').val('".nl2br2($rsquery[0])."')"; ?>
PHP Manual link