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

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

报告相同问题?

悬赏问题

  • ¥20 蓝牙耳机怎么查看日志
  • ¥15 Fluent齿轮搅油
  • ¥15 八爪鱼爬数据为什么自己停了
  • ¥15 交替优化波束形成和ris反射角使保密速率最大化
  • ¥15 树莓派与pix飞控通信
  • ¥15 自动转发微信群信息到另外一个微信群
  • ¥15 outlook无法配置成功
  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏