Saturday, February 13, 2010

FCKeditor-Javascript and Codeigniter integration

here is the script for your view:
<script src="<?php echo base_url()?>javascripts/fck/fckeditor.js" type="text/javascript">
</script>
<script type="text/javascript">
  window.onload = function(){
    var oFCKeditor = new FCKeditor('isi','100%','300','noUpload');
    oFCKeditor.BasePath = 'javascripts/fck/';
    oFCKeditor.Config['CustomConfigurationsPath'] = oFCKeditor.BasePath+'fckconfig.js?';
    oFCKeditor.Config['SkinPath'] = oFCKeditor.BasePath+'editor/skins/silver/';
    oFCKeditor.ReplaceTextarea();
  }
</script>
........
<form action="<?php echo site_url('admin/post/');?>" method="post">
  <table border="0" cellpadding="0" cellspacing="0">
    <tr><td>
      <textarea cols="70" name="content" rows="15"><?php echo $content;?></textarea>
    </td></tr>
    <tr><th><input type="submit" value="Simpan" /></th></tr>
  </tbody></table>
</form>

thats only simple way

1 comment: