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()
– fernandosavio
Currently the value of Ckeditor with Ckeditor.replace('txtArtigo').
– Noscin
Send a piece of your code to Ckeditor
– LuisHF