I have been working on saving the data that I entered in a textarea with TinyMCE this is my textarea
<form class="form-horizontal" method="POST" action="{{ route('dgc.vwexpedientes_assign.actualizar_dictamen', $dictamen_t->id) }}">
{{ csrf_field() }}
{{ method_field('PUT') }}
<textarea id="dict" name="dict">
<div>
<center>
<h4>Autoridad Nacional del Agua</h4>
<h5>ANA</h5>
<h6>Dirección General de Concesiones</h6>
<p>Expediente No.</p>
</center>
</div>
</textarea>
<div class="box-footer">
<button class="btn btn-success pull-right" type="submit">Actualizar</button>
</div>
</form></textarea>
This is my JavaScript:
tinymce.init({
selector: '#dict',
height: 800,
fontsize_formats: '8pt 10pt 12pt 14pt 18pt 24pt 36pt',
theme: 'modern',
font_formats: 'Courier New=courier new,courier,monospace;Arial=arial,helvetica,sans-serif;AkrutiKndPadmini=Akpdmi-n',
plugins: 'print preview fullpage powerpaste searchreplace autolink directionality advcode visualblocks visualchars fullscreen image link media template codesample table charmap hr pagebreak nonbreaking anchor toc insertdatetime advlist lists textcolor wordcount tinymcespellchecker a11ychecker imagetools mediaembed linkchecker contextmenu colorpicker textpattern help',
toolbar1: 'formatselect | bold italic strikethrough forecolor backcolor | link | alignleft aligncenter alignright alignjustify | numlist bullist outdent indent | removeformat',
image_advtab: true,
templates: [
{ title: 'Test template 1', content: 'Test 1' },
{ title: 'Test template 2', content: 'Test 2' }
],
content_css: [
'//fonts.googleapis.com/css?family=Lato:300,300i,400,400i',
'//www.tinymce.com/css/codepen.min.css'
],
});
and this is my controller:
public function actualizar_dictamen(Request $request, $id_dictamen)
{
$dictamen = dictamen_tecnico::find($id_dictamen);
$dictamen->tecnico = $request->get('dict');
//$dictamen->estado = 2;
$dictamen->save();
return back()->with('flash', 'Dictamen Tecnico Actualizado');
}
How can you store the data inside the tinyMCE and then also be able to visualize it in the same way in the textarea and the tinyMCE?
Help please.