I did something similar with Tinymce with PHP, javascript and HTML, if it works:
For the Tynmce script
$('textarea.editable').tinymce({
//Ruta del archivo
script_url : '../js/tiny_mce/tiny_mce.js',
//El modo en que va a operar, normalmente se recomiendan textareas
mode:"textareas",
// Opciones generales
theme : "advanced",
plugins:"preview",
// Las opciones del tema
theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
theme_advanced_buttons2 : "undo,redo,|,forecolor,backcolor,|,preview",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
theme_advanced_resizing : true
});
To save what exists in the textarea, I simply put it in a form and with its submit button
<form name="formulario" id="formulario">
<textarea class="editable"></textarea>
<button type="submit" id="boton_ini" name="boton_ini" class="tbtnazul">Guardar</button>
</form>
Note: Here it depends on how many things you want to send.
Afterwards, in the submit I sent the content to a php function to update the document.
For example for the project you use with Postgresql
pg_send_query_params($conexiondb, 'UPDATE constancia SET constrech = $documento WHERE material = $id;', array($id, $documento));
$res = pg_get_result($conexiondb);
$codErr = pg_result_error_field($res, PGSQL_DIAG_SQLSTATE);
pg_free_result($res);
if($codErr !== null && $codErr !== ''){ return obtener_ErrorDB($codErr); }
return true;
That would be an example of how to update your content and if you want to enter the content just print a PHP VARIABLE with your SELECT query.