Froala Editor v4.2.1 is HereLEARN MORE

Skip to content

Save Concepts

Save Button

To save the content of the editor you can defined an external button and call the method that makes a HTTP requests from JS to saveURL. Your server has to handle the request an it is up to you to handle the requests on server side and store the data.

An alternative to defining a button that calls the save method is to include the save button in the toolbarButtons option. The button would automatically call the save method when it is hit, but you still have to define the save options like below.

Save options

There are up to 4 options and 3 events that can be customized for the save action:
saveParam tells the editor in which parameter of the request to put the edited content. By default it is set into the body param.
saveURL is the most important option, it is the URL where the save request is made.
saveMethod specifies the HTTP request type for the save action.
saveParams option can be used to pass additional parameters in the request. event is triggered before the save request and it can be used to set additional save params or cancel the save action. event is triggered after a successfully save request. event is triggered if any error occurs during the upload process.

Initialize the WYSIWYG HTML editor and save button

<div id="myEditor"></div>
<button id="saveButton">Save</button>

  $(function() {
        // Set the save param.
        saveParam: 'content',

        // Set the save URL.
        saveURL: '',

        // HTTP request type.
        saveMethod: 'POST',

        // Additional save params.
        saveParams: {id: 'my_editor'}
      .on('', function (e, editor) {
        // Before save request is made.
      .on('', function (e, editor, response) {
        // After successfully save request.
      .on('', function (e, editor, error) {
        // Do something here.

  $('#saveButton').click (function () {

Receive request on the server

When the save button is hit, the editor will make a HTTP request to your server. The content will be sent in the content parameter of the request and the server has to process the request and save the data in the DB. If any additional saveParams are passed they will also be included in the request.

PHP example: For the code above you would get the rich text editor's content in $_POST['content'] variable and the additional information in $_POST['id'].