Save Concepts
Save inside FORM
Saving the content of the rich text editor inside a FORM is the easiest way to get the edited content on server side and store it. Basically, the WYSIWYG HTML editor is initialized on a textarea
inside a form and the content is sent to the server as value of the textarea
.
Initialize the WYSIWYG HTML editor
<form action="save" method="POST">
<textarea name="editor_content" id="myEditor"></textarea>
<button>Submit</button>
</form>
<script>
new FroalaEditor('#myEditor', {toolbarInline: false})
</script>
Receive request on the server
When the submit button is hit, the FORM content will be sent to the server. The content will be sent in the editor_content
parameter of the request (which is the name of the textarea) and the server has to process the request and save the data in the DB.
PHP example: For the code above you would get the rich text editor's content in $_POST['editor_content']
variable.