Formatting input text with a jeditable textarea
I have a textarea that is editable using jeditable (jquery), I need a way of the users input into formatted text; for example, if the user would like to enter the following:
This is a letter from God to Man.
Hi How's it going???
Currently this is returned as:
This is a letter from God to Man. Hi How\'s it going???
Some sort of string replace, i guess...
jeditable function:
$(".editable_textarea").editable("<?php print $url ?>save.php?id=<?php print $_开发者_运维技巧SESSION['id'] ?>", {
indicator : "<img src='../images/indicator.gif'>",
type : 'textarea',
submitdata: { _method: "put" },
select : true,
submit : 'OK',
cancel : 'cancel',
cssclass : "selected",
height : '200px'
});
Textarea:
<span class="editable_textarea" id="letter"><?php print file_get_contents($url . 'load.php?id=letter&sid='.$_SESSION['id'].'') ?></span>
Thanks and any help is welcome.
B.
This is a long dead question I guess, but:
<span class="editable_textarea" id="letter"><?php print stripslashes(file_get_contents($url . 'load.php?id=letter&sid='.$_SESSION['id'].'')) ?></span>
精彩评论