fckeditor 相关问题

WYSIWYG HTML编辑器和CKEditor的前身

如何在laravel中获取Ckeditor文本区域值

我正在使用 Ckeditor 在我的项目中发布博客,当我提交表单时,我在控制器中没有得到任何内容,任何人都可以建议我解决该问题。 我的观点看起来像 我正在使用 Ckeditor 在我的项目中发布博客,当我提交表单时,我在控制器中没有得到任何内容,任何人都可以建议我解决该问题。 我的观点看起来像 <div class="container"> <div class="row"> <div class="col-md-10 col-md-offset-2"> <div class="panel panel-default"> <div class="panel-heading">Post</div> <div class="panel-body"> <form class="form-horizontal" role="form" method="POST" action="{{ route('store-post') }}"> {{ csrf_field() }} <div class="form-group"> <label for="category_id" class="col-md-2 control-label">Select Categories</label> <div class="col-md-8"> <select class="form-control" id="category_id" name="category_id"> @foreach($categories as $category) <option value="{{$category->url_name}}"> {{$category->category_name}}</option> @endforeach </select> </div> </div> <div class="form-group"> <label for="email" class="col-md-2 control-label">Post Title</label> <div class="col-md-8"> <input id="post_title" type="text" class="form-control" name="post_title" value="{{ old('post_title') }}"> </div> </div> <div class="form-group"> <label for="post_content" class="col-md-2 control-label">Post Description</label> <div class="col-md-8"> <textarea id="post_content" rows="10" cols="60" class="span8" placeholder="Image Title Goes Here" name="post_content"></textarea> </div> </div> <div class="form-group"> <label for="p_url" class="col-md-2 control-label">Post Url</label> <div class="col-md-8"> <input id="p_url" type="text" class="form-control" name="p_url" value="{{ old('p_url') }}"> </div> </div> <div class="form-group"> <label for="p_title" class="col-md-2 control-label">Meta Title</label> <div class="col-md-8"> <input id="p_title" type="text" class="form-control" name="p_title" value="{{ old('p_title') }}"> </div> </div> <div class="form-group"> <label for="p_keyword" class="col-md-2 control-label">Meta Keyword</label> <div class="col-md-8"> <input id="p_keyword" type="text" class="form-control" name="p_keyword" value="{{ old('p_keyword') }}"> </div> </div> <div class="form-group"> <label for="email" class="col-md-2 control-label">Meta Description</label> <div class="col-md-8"> <textarea class="form-control" id="p_mdesc" name="p_mdesc" rows="3"> </textarea> </div> </div> <div class="form-group"> <div class="col-md-8 col-md-offset-2"> <button type="submit" class="btn btn-primary"> Submit </button> </div> </div> <!--Error start--> @if ($errors->any()) <div class="alert alert-danger"> <ul> @foreach ($errors->all() as $error) <li>{{ $error }}</li> @endforeach </ul> </div> @endif <!--error ends--> </form> </div> </div> </div> </div> </div> 我的控制器代码是 public function store(Request $request){ /*$this->validate($request, [ 'category_id' => 'required', 'post_title' => 'required', //'post_content' => 'required', 'p_url' => 'required', 'p_title' => 'required', 'p_keyword' => 'required', 'p_mdesc' => 'required', ]);*/ $post=new Post; echo $post_content=$request->input('post_content'); } 在之前的项目中,即在 CI 中设计的我只是使用 $tc=$this->input->post('tc'); 在控制器中用于获取 Ckeditor 值,但在 laravel 中我不知道如何完成它。 您的视图包含 post_content 字段(文本区域)的 2 个名称属性。请检查。 你可以这样做- {!! Form::textarea('tc', $tc,array('required', 'class'=>'form-control', placeholder'=>'Your message')) !!} 然后你必须初始化它 $(document).ready(function () { CKEDITOR.replace( 'tc' ); }); 文档有清晰的示例。 在你的 Blade 中你应该像这样添加 ckeditor: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>A Simple Page with CKEditor</title> <!-- Make sure the path to CKEditor is correct. --> <script src="../ckeditor.js"></script> </head> <body> <form> <textarea name="editor1" id="editor1" rows="10" cols="80"> This is my textarea to be replaced with CKEditor. </textarea> <script> // Replace the <textarea id="editor1"> with a CKEditor // instance, using default configuration. CKEDITOR.replace( 'editor1' ); </script> </form> </body> </html> 因此 javascript 代码会触发编辑器中文本区域的替换 现在是检索数据部分 <script> var data = CKEDITOR.instances.editor1.getData(); // Your code to save "data", usually through Ajax. </script> 如果您想通过 Ajax 发送此数据,您需要创建一个端点。不要忘记添加 CSRF 令牌 正如@user3888958所提到的, 名称=“tc”</b>id=“post_content”行=“10”列=“60” class =“span8”placeholder =“图像标题在这里”<b>name =“post_content”</b>> </pre> <p>文本区域有两个名称属性。</p> <p>您可以使用名称属性访问文本区域内容,删除任何一个名称属性并将其作为参数传递给请求</p> <pre><code>$request->input('tc'); // OR $request->input('post_content'); </code></pre> <p>并访问</p>的值 <pre><code><textarea class="form-control" id="p_mdesc" name="p_mdesc" rows="3"> </textarea> </code></pre> <p>您可以使用名称访问它</p> <pre><code>$request->input('p_mdesc'); </code></pre> </answer> <answer tick="false" vote="0"> <p><strong>ckeditor 5</strong></p> <pre><code> <div id="editor">This is some sample content.</div> <script> ClassicEditor .create( document.querySelector( '#editor' ) ) .then( editor => { const data = editor.getData(); console.log( data ); // <------ } ) .catch( error => { console.error( error ); } ); </script> </code></pre> </answer> </body></html>

回答 4 投票 0

可以在商业网站中使用CKEditor吗? [已关闭]

我打算在商业网站中使用CKEditor。我读过 http://ckeditor.com/license 但我不明白当他们提供 LGPL 时怎么可能为商业用途定价(这是很好的选择...

回答 2 投票 0

如何检查CKEditor中是否有文本?

我有一个包含几个字段的 HTML 表单。其中之一是由 CKEditor 管理的文本区域。 当用户想要提交表单时,我想检查他是否在所有字段中输入了值。 我知道...

回答 8 投票 0

CKEditor 4如何禁用图像上传弹出窗口?

我正在使用CKEditor 4.13版本。当我在ckeditor上复制粘贴或拖放图像时,将打开一个对话框,例如单击此处。如何禁用此弹出窗口?我对此很陌生。请帮助。

回答 1 投票 -1

如何以编程方式在CKEDITOR中选择文本范围?

问题:我的javascript中有一个CKEditor实例:var editor = CKEDITOR.instances [“ id_corpo”];并且我需要以编程方式插入一些文本,然后选择一些文本范围。我已经...

回答 4 投票 7

FCKeditor阿拉伯语不出来

我在一个项目中使用FCKeditor。

回答 1 投票 1

为基于Web的电子邮件应用程序调整所见即所得编辑器

我有一个发送电子邮件的Web应用程序,对于文本格式,我需要为电子邮件正文实现一个所见即所得的编辑器。我已经尝试过Tinymce和fckeditor,但是这些编辑器的主要问题是...

回答 5 投票 2

FCKeditor文本框中的纯文本

我有一个旧版Web应用程序,我需要迁移到新的Windows Server(从2008r2迁移到2019),并且一直遇到一些安全问题。主要带有富文本格式的文本框...

回答 1 投票 0

是否有任何理由为什么asp:Button可以工作但是asp:LinkBut ton不会?

我正在为服务台构建管理门户。在一个页面上,我有一个带LinkBut ton的下拉列表,另一个带有Button的下拉列表。两个按钮都通过触发重定向到他们点击的页面...

回答 4 投票 0

CK Editor默认字体系列和字体大小

如何更改CK Editor的默认字体系列和字体大小。默认情况下,我需要设置我的字体系列和字体大小。我试过这个,config.font_defaultLabel ='Georgia';配置....

回答 1 投票 0

如何在PHP或JavaScript中使用重置按钮重置FCKeditor?

见下图。我在表单的末尾添加了一个重置 按钮。当用户按“重置”时,我可以清除所有输入。但我不知道如何清除这个FCKeditor值。图片

回答 2 投票 1

基于实时网络的富文本编辑器

有没有人知道像TinyMCE或FCKEditor这样支持实时协作的基于Web的富文本编辑器?我知道像EtherPad这样的系统,但我有兴趣找到可以嵌入的东西......

回答 3 投票 3

KCFinder分配目录用户:uploadfolder / usernamefolder / img而不是uploadfolder / img

我想知道是否有一个明确的方法或示例如何为我的Web平台的每个用户分配一个目录。我试过搜索,我看过很多例子,但没有明确或更新的......

回答 1 投票 0

© www.soinside.com 2019 - 2024. All rights reserved.