Monday, June 25, 2012

How To Use HTML Editor online

how to use html editor

1. download html editor from http://nicedit.com/download.php

2.  copy and paste in a folder ,  Example: A   folder name

3. now create new folder within folder , Example : B    Folder name

4.   two file  nicEdit.js   and   nicEditorIcons.gif   (get from download)  paste on A folder

5.create demo.html file , on folder

6.  demo.html

<script type="text/javascript" src="../nicEdit.js"></script>
<script type="text/javascript">
// add text editor 
bkLib.onDomLoaded(function(){
var myEditor = new nicEditor({fullPanel : true }).panelInstance('mytxtarea');
  myEditor.addEvent('add', function() {   });
});
</script>


<h4>Textarea</h4>
<textarea name="area1" cols="40" id="mytxtarea" name="mytxtarea">     </textarea>


7. how to get content from nicedit 
function getcontain(){
var nicE = new nicEditors.findEditor('mytxtarea'); // for use validation time
value = nicE.getContent();
alert(value);
}

8. how to set content from nicedit
function setcontain(){
nicEditors.findEditor('mytxtarea').setContent(' <strong>Some HTML</strong> here');  // for use update time
}





No comments:

Post a Comment

If you Satisfied , Please Leave a comment