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

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

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

머가 문제일까요

답변 2개

채택된 답변
+20 포인트

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, ''), ['&nbsp;','<p>&nbsp;</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;

 

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

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

로그인 후 평가할 수 있습니다

답변에 대한 댓글 1개

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 출력하셔서 정상적으로 일단 갔는지 확인하시고 제대로 안갔으면 보내는쪽을 체크해보셔야 할거 같습니다.

로그인 후 평가할 수 있습니다

답변에 대한 댓글 1개

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 로 노출 ?>

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

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인
🐛 버그신고