これをテキストエリアからデータベースに挿入します。
Hello
How
Are
You
次のように保存されます。
Hello\n\nHow \n\nAre \n\nYou
しかし、それを入れた後にテキストエリアに表示すると、nl2br
まだHello\n\nHow \n\nAre \n\nYou
. データベースに挿入したときと同じように表示するにはどうすればよいですか?
これは、値を取得するために使用している jQuery コードです。
var getURL = WEBROOT + "index.php/Connection/getConfig/" + rowID;
var editConfig = $("<div>");
editConfig.load(getURL, function(){
var configValue = $(this).html();
console.log(configValue);
var button = $("<button>", {
html: "submit"
}),
textArea = $("<textarea>",{
width: "350px", height: "600px"
}).val(nl2br(configValue));
$(this).text("").append(
textArea,
$("<br/>"),
button
).dialog({
title: "Editing Config for id " + rowID,
modal: true,
width: 405
});
});