dongwen2794 2016-11-16 23:50
浏览 134
已采纳

使用laravel 5从文本编辑器中获取文本

I would like to get the html code of a texteditor.

I use this texteditor http://adminbootstrap.com/wb/right/0.3.0/texteditor.html .

I've a form with the texteditor inside it but when I would like to get the html code with:

$request->input('texteditor');

It doesn't work and whereas I gave a name to the texteditor,

What is going wrong ?

My view code :

<form>
<div class="container-fluid half-padding">
    <div class="pages pages_dashboard">
      <div class="row">
         <div class="col-md-12">
            <div class="panel panel-warning">
               <div class="panel-heading">
                   <h3 class="panel-title">Contenu de l'actualitée</h3>
               </div>
               <div class="template template_texteditor">
                  <div class="summernote"></div>
               </div>
           </div>
       </div>
   </div>
   </div>
 </div>
</form>

And

<div class='summernote'></div>

dynamically creating other div and the html code is contained in

<div class='note-editable panel-body' name='texteditor'></div>

texteditor code

EDIT 1

Another way :

$('.summernote').summernote('code');

to get the entire html code of summernote texteditor

  • 写回答

1条回答 默认 最新

  • dongmi5015 2016-11-17 07:31
    关注

    You currently have no textarea form field that is being sent back to the server that contains the wanted content.

    The simple thing would be to change

     <div class='note-editable panel-body' name='texteditor'></div>
    

    to

     <textarea class='note-editable panel-body' name='texteditor'></textarea>
    

    or run some javascript on form submit to add this as post['textarea'] from the TEXT of the div content

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?