스마트에디터에 값이 전혀 넘어가지지 않아요..

스마트에디터에 값이 전혀 넘어가지지 않아요..

QA

스마트에디터에 값이 전혀 넘어가지지 않아요..

본문

<?php echo editor_html('news_content', $content , true);

위에 인클루드로 스마트 에디터를 불러와서 글을적고 값을 넘기는데 전혀 넘어가지않네요..

머가 문제일까요

이 질문에 댓글 쓰기 :

답변 2

var wr_content_editor_data = oEditors.getById['wr_content'].getIR();
oEditors.getById['wr_content'].exec('UPDATE_CONTENTS_FIELD', []);
if(jQuery.inArray(document.getElementById('wr_content').value.toLowerCase().replace(/^\s*|\s*$/g, ''), [' ','<p> </p>','<p><br></p>','<div><br></div>','<p></p>','<br>','']) != -1){document.getElementById('wr_content').value='';}
if (!wr_content_editor_data) { alert("내용을 입력해 주십시오."); froala.instances.wr_content.focus(); return false; }
if (typeof(f.wr_content)!="undefined") f.wr_content.value = wr_content_editor_data;

 

위 부분이 전송시 스크립트 반영되어 있는지 체크해보시거나

아이디값을 수정해 반영해 주셔야 합니다.

function get_editor_js($id, $is_dhtml_editor=true)
{
    if ($is_dhtml_editor) {
        return "var {$id}_editor_data = oEditors.getById['{$id}'].getIR();\noEditors.getById['{$id}'].exec('UPDATE_CONTENTS_FIELD', []);\nif(jQuery.inArray(document.getElementById('{$id}').value.toLowerCase().replace(/^\s*|\s*$/g, ''), ['&nbsp;','<p>&nbsp;</p>','<p><br></p>','<div><br></div>','<p></p>','<br>','']) != -1){document.getElementById('{$id}').value='';}\n";
    } else {
        return "var {$id}_editor = document.getElementById('{$id}');\n";
    }
}
이렇게 선언이 되어있고

include_once(G5_EDITOR_PATH.'/'.$config['cf_editor'].'/editor.lib.php');
$editor_js = '';
$editor_js .= get_editor_js('news_content', true);
$editor_js .= chk_editor_js('news_content', true);
이렇게 호출을 했는데 id값을 news_content로 못받아들이네요..

받는 페이지에서 post 출력하셔서 정상적으로 일단 갔는지 확인하시고 제대로 안갔으면 보내는쪽을 체크해보셔야 할거 같습니다.

include_once(G5_EDITOR_PATH.'/'.$config['cf_editor'].'/editor.lib.php');
$editor_html = editor_html('news_content', $content, $is_dhtml_editor);
$editor_js = '';
$editor_js .= get_editor_js('news_content', true);
$editor_js .= chk_editor_js('news_content', true);
<?php echo editor_html('news_content', $content , true);// 에디터 사용시는 에디터로, 아니면 textarea 로 노출 ?>

이렇게 스마트에디터는 가져와지는데
페이지자체에서도 값이 안찍히네요.. 머가 잘못된걸까요?

답변을 작성하시기 전에 로그인 해주세요.
전체 18
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT