troubleshooting Question

Could you point why this HTML textarea is not actualized when changing the pictures since JS scripts shows it has changed?

Avatar of Eduardo Fuerte
Eduardo FuerteFlag for Brazil asked on
LaravelHTMLJavaScriptPHP
9 Comments1 Solution83 ViewsLast Modified:
Hi Experts

Could you point why this HTML textarea is not actualized when changing the pictures since JS scripts shows it has changed?

Accordingly to:

 img002
What occurs is:
img003
Page Code:
  <div class="modal fade" id="mMidiaEditar" tabindex="-1" role="dialog" aria-labelledby="mMidiaEditarLabel">
    <div class="modal-dialog modal-lg" role="document">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
          <h4 class="modal-title" id="mMidiaEditarLabel">Mídia</h4>
        </div>
        <div class="modal-body">
          {{ csrf_field() }}
          <input type='hidden' id='id'/>
          <div class='form-group'>
            <label for='tituloEditar'>Título:</label>
            <input type='text' class='form-control' id='tituloEditar' name='tituloEditar'/>
          </div>

<!--  --->
          <div class='form-group'>
            <label for='descricaoEditar'>Descrição X:</label>
            <textarea class='form-control' id='descricaoEditar' name='descricaoEditar' rows="5"></textarea>
          </div>
<!--  --->

          <div class='form-group'>
            <label for='tipoparticipanteEditar'>Perfil:</label>
            <select id='tipoparticipanteEditar' name='tipoparticipanteEditar' class='form-control'>
              <option value='0'>Para todos os perfis</option>
              @foreach($tipoparticipantes as $tipoparticipante)
                <option value="{{ $tipoparticipante->id}}">{{ $tipoparticipante->nome}}</option>
              @endforeach
            </select>
          </div>

        </div>

        <div class="modal-footer">
          <button type="button" class="btn btn-default" data-dismiss="modal"><i class="fas fa-times" aria-hidden="true"></i> Fechar</button>
          <button type="submit" class="btn btn-primary" onclick='hotsite.vitrine.atualizar();'><i class="fas fa-hdd" aria-hidden="true"></i> Salvar</button>
        </div>
      </div>
    </div>
  </div>

JS Code:
Vitrine.prototype.editarAdmin = function(id){
  $.ajax(
    {
        url: '/admin/vitrine/'+id+"/obter",
        method: "GET",
        error: function () {
          hotsite.openModalCustom("Erro", "Erro ao obter dados da vitrine.", "Entendi", "error");
        },
        success: function (data) {
          id = data.retorno.id;
          titulo = data.retorno.titulo;
          
    
          descricao = data.retorno.descricao;
          tipoparticipante_id = data.retorno.tipoparticipante_id;
          
          
          console.log(descricao);
          
          $('#id').val(id);
          $("#tituloEditar").val(titulo);
          $('#descricaoEditar').val(descricao);
          
          
          $('#tipoparticipanteEditar').val(tipoparticipante_id);
          //tinyMCE.get('descricaoEditar').setContent(descricao);
          hotsite.openModal('mMidiaEditar');
        }
    });
}


Thanks in advance.
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 9 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 9 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros