开发者

jquery-in-place-editor and BR

I'm using http://code.google.com/p/jquery-in-place-editor/

In my 'p' tag I have :

<p id="editme2">Hello...<br />Hi</p>

But editing the text produce "Hello...Hi" in the textarea (one line)

How can I replace 'br' with开发者_JAVA百科 \n when the text show up in the textarea ?

I'm using :

$j("#editme2").editInPlace({
        url: "admin.sub.inc.php",
        bg_over: "#DBE5C0",
        field_type: "textarea",
        textarea_rows: "15",
        textarea_cols: "35",
        saving_image: "../images/indicator.gif",
        value_required: true,
        show_buttons: true,
        success: function(data){
            var result = data.replace(/(\r\n|\r|\n)/g, "<br />");
            $j("#editme2").html(result);
        }
    });

Thanks for your help...


Use "pre" tag instead of "p" tag.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜