繁体   English   中英

如何使用jQuery在TinyMce中以表单模式获取值textarea

[英]How to get value textarea in tinymce on form modal using jquery

单击编辑数据时,我尝试使用表单内的引导模式和tinymce进行表单编辑。 数据未在tinymce中显示,请参见图像, 与tinymce形成模态

这是我的代码

function edit(id){

save_method = "update";
$('#form')[0].reset();
$('.form-body').removeClass('has-error');
$('.help-block').empty();

$.ajax({
        url: '<?php echo site_url("profil/ajax_edit/")?>/'+id,
        type: 'GET',
        dataType: 'JSON',
        success: function(data)
        {
            $('[name="profil_id"]').val(data.profil_id);
            $('[name="post_nama"]').val(data.nama);
            $('[name="post_jk"]').val(data.jenis_kelamin);
            $('[name="post_date"]').val(data.tanggal_lahir);
            $('[name="post_kota"]').val(data.id_kota);
            $('[name="post_alamat"]').val(data.alamat);
            $('[name="post_email"]').val(data.email);
            $('[name="post_telepon"]').val(data.telepon);
        if (data.profil_status == 'active'){
            $(':radio[name=post_status][value="active"]').prop('checked', true);
        } else {
            $(':radio[name=post_status][value="notactive"]').prop('checked', true);
        }   

        if(data.photo){
            $('#photoPreview').html('<img src="'+base_url+'upload/profil/'+data.photo+'" width="75" height="50">');
        }
            $('#modal_form').modal('show');
            $('.modal-title').text('Edit Profile');

        },
         error: function (jqXHR, textStatus, errorThrown)
    {
        alert('Error get data from ajax');
    }

});

}

您不能在js包含php

$.ajax({
    url: '<?php echo site_url("profil/ajax_edit/")?>/'+id,

正确添加您的路径。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM