D
D
Denioo2020-04-04 12:29:11
JavaScript
Denioo, 2020-04-04 12:29:11

How to save data from TinyMCE to firebase?

I ran into a problem, I can’t bring textarea tinyMCE into the firebase database using the usual mytextArea.value using the usual method. Any text that I enter just goes blank. I catch submit events and send them to firebase via fetch. Everything is ok with other inputs, so it's TinyMCE.

addArticleForm.addEventListener('submit', (event) => {
    event.preventDefault()
    const input = addArticleForm.querySelectorAll('input')
    const mytextArea = addArticleForm.querySelector('#mytextarea')

    const article = {
        header: input[0].value,
        subDesc: input[1].value,
        img: input[2].value,
        desc: mytextArea.value //TinyMCE
    }
    
    
    Article.create(article)
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
McThinker, 2020-04-04
@Denioo

tinymce.activeEditor.getContent() try this to get the entered data

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question