i'm using nicedit js which is is a WYSIWYG editor in my textarea to view html doc, but it still editable, how to set this nicedit to readonly mode, i try to search from its doc but unable to find it, do any one have experience using nicedit,
thanks in advance
Here is a helpful jQuery solution that I use with nicEdit:
jQuery('.nicEdit-main').attr('contenteditable','false');
jQuery('.nicEdit-panel').hide();
You can simply change it back to 'true' to make it editable again.
Note: I would consider toggling the div background-color along with this solution.
finally the solution is
var myNicEditor = new nicEditor(); myNicEditor.addInstance('templateContent'); nicEditors.findEditor("templateContent").disable();
With the statement
nicEditors.findEditor("TextArea").disable(); niceditor
is non editable
But
nicEditors.findEditor("TextArea").attr("contentEditable","true");
does not make it editable again
for me only this worked:
document.getElementsByClassName('nicEdit-main')[0].removeAttribute('contentEditable');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With