Pull html editor txtarea through select

Asked

Viewed 30 times

0

Good afternoon, I’m having trouble correctly displaying the contents of a select inside the html editor. Code below:

<form>
    <div class="form-group">
    <label for="exampleFormControlSelect1">Selecione a página</label>
    <select class="form-control" id="page" data-placeholder='Nenhum valor selecionado...'>
        @foreach($paginas as $paginas)
      <option value="{{$paginas->conteudo}}">{{$paginas->titulo}}</option>
      @endforeach
    </select>
  </div>
</form>


<button onclick="pegarValores()">Verificar</button>

 <script type="text/javascript">
 function pegarValores(){
    var texto = $('#page').text();
    var valor = $('#page').val();
    var conteudo = document.getElementById("txtArtigo").value = valor;
 }

 </script>

             <textarea id="txtArtigo" name="txtArtigo">
                    <div id="resultado"></div>
            </textarea>
</div>

Before loading the html editor,I click on check and the code works but then does not work,the idea is that it already works even after loading the editor.

  • In principle to change the data value of the Ckeditor is used CKEditor.setData()

  • Currently the value of Ckeditor with Ckeditor.replace('txtArtigo').

  • Send a piece of your code to Ckeditor

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.