Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

77
Visualizações
Sending content from TinyMCE to Airtable

I've implemented TinyMCE on an app I've created, and would like to have it submit the textarea's content to Airtable on button click. The thought process is: retrieve the textarea data, pull some basic information about the user and the Airtable table I'd like to write to, and then create a new record. I'm running into trouble getting the function up and running, though; can anyone take a look at the code below and see where I'm going wrong?

For reference, here's what I have so far:

Header

<script src="https://cdn.jsdelivr.net/npm/@editorjs/editorjs@latest"></script>
<script src="https://cdn.jsdelivr.net/npm/airtable@0.11.3/lib/airtable.umd.min.js"></script>
<script src="https://cdn.tiny.cloud/1/myapikeyhere/tinymce/6/tinymce.min.js" referrerpolicy="origin"></script>
<script>
      tinymce.init({
        selector: '#mytextarea',
        branding: false
      });
</script>

Body

<textarea id="mytextarea">Start typing here!</textarea><br><br>
<button onclick="sendtoAirtable()" class="button">Create Post</button>
 
<script src="https://requirejs.org/docs/release/2.3.5/minified/require.js"></script>
<script>
    function sendtoAirTable(){
        var data = tinymce.instances.mytextarea.getData();
        saveToAirTable(data);
    
        function saveToAirTable(data){
            var userId = window['logged_in_user']['airtable_record_id']
            var base = new Airtable({apiKey: 'myapikey'}).base('airtablebaseid');
        }
    
        base('tablename').create([
            {
               "fields": {
                  "Content":data,
                  "User": [
                     userId
                  ]
               }
            }
        ], function(err, records) {
            if (err) {
                 console.error(err);
                 return;
                }
         });
    }
</script>
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda