Actions -> clearFields

Remove all fields from the editor with this handy action.

Usage

  const fbEditor = document.getElementById("build-wrap");
  const options = {
    defaultFields: [
      { type: "text" },
      { type: "checkbox-group" },
      { type: "text" },
      { type: "radio-group" }
    ]
  };
  const formBuilder = $(fbEditor).formBuilder(options);

  const clearFieldsButton = document.getElementById("clear-all-fields")
  clearFieldsButton.addEventListener('click', () => {
      formBuilder.actions.clearFields() // clear all fields
  }, false)

See it in Action