【发布时间】:2014-12-09 05:41:42
【问题描述】:
我正在使用summernote编辑文本,当我通过summernote工具栏或菜单为文本赋予样式时,它会出现,但是在提交文本和html标签后存储在数据库中,样式由此转义。
<div id="summernote"><?php echo stripslashes($career['description']); ?></div>
<textarea class="form-control" id="deschere" name="desc" placeholder="Description" rows="20" style="display: none;"></textarea>
脚本
<script type="text/javascript">
$('#thisform').submit(function(e){
$('#deschere').html($('#summernote').code());
console.log($('#deschere').html());
//e.preventDefault();
});
存储在数据库中的代码
$data['title']= $this->input->post('title');
$data['description']= $this->input->post('desc');
$data['date']=date('Y/m/d h:i');
$id=$this->input->post('id');
$this->db->where('id',$id);
$response=$this->db->update('careers',$data);
return $response;
有人对此有解决方案吗? 谢谢。
【问题讨论】:
标签: php summernote