Send Blog Post Content via Email
Send Blog Post Content via Email
tinymce.init({
selector: ‘#editor’,
height: 500,
plugins: [
‘advlist autolink lists link image charmap print preview anchor’,
‘searchreplace visualblocks code fullscreen’,
‘insertdatetime media table paste code help wordcount’
],
toolbar: ‘undo redo | formatselect | ‘ +
‘bold italic backcolor | alignleft aligncenter ‘ +
‘alignright alignjustify | bullist numlist outdent indent | ‘ +
‘removeformat | help’,
setup: function (editor) {
editor.on(‘change’, function () {
// Update the hidden textarea with Tinymce content
tinymce.triggerSave();
});
}
});
document.getElementById(‘blogPostForm’).addEventListener(‘submit’, function (e) {
e.preventDefault(); // Prevent default form submission
var form = this;
// Update the hidden textarea with Tinymce content before submitting the form
tinymce.triggerSave();
form.submit(); // Submit the form
});
