먼저 CKeditor로 내 문제를 해결할 수있는 사람이 있는지 알 수 없습니다.CKedit 데이터가 PHP 유효성 검사에서 인식되지 않음 Codeigniter
내 컨트롤러 코드 :
public function reply_topic()
{
$this->load->helper('form');
$this->load->library('form_validation');
$this->form_validation->set_rules('comment', 'Comment Field Required', 'required');
//$this->form_validation->set_rules('g-recaptcha-response', 'recaptcha validation', 'required|callback_validate_captcha');
//$this->form_validation->set_message('validate_captcha', 'Please check the the captcha form');
if ($this->form_validation->run() == FALSE)
{
$this->load_reply_to_topic_view($this->input->post('topic_id'));
}
else
{
$topic_id = $this->input->post('topic_id');
$this->topic_model->postReplyTopic();
echo '<div class="alert alert-success">'.lang_key('reply_submited').'</div>';
$this->load_reply_to_topic_view($topic_id='');
}
}
이 코드는 작업 벌금을 시작하는 문제가 발생하지 않습니다. 그러나 데이터를 제출할 때 항상 오류가 발생합니다. 처럼 댓글 입력란에 이미 데이터를 입력했지만이 비어 있습니다.이 오류는 내가 CKeditor를 사용하고있을 때 나타납니다. 하지만 난 단지 일반 텍스트 영역을 사용하면 정말 잘 작동합니다. 여기
<!-- Javascript -->
<script type="text/javascript">
CKEDITOR.replace('comment');
</script>
그리고
는 코멘트 섹션 실제로 텍스트 영역 필드를 사용하지 않는<script type="text/javascript">
var loadUrl = '<?php echo base_url("threads/load_reply_to_topic_view/".$item['id']);?>';
jQuery.post(
loadUrl,
{},
function(responseText){
jQuery('.reply-topic-form-holder').html(responseText);
init_reply_topic_js();
}
);
function init_reply_topic_js()
{
jQuery('#replytopic-form').submit(function(e){
var data = jQuery(this).serializeArray();
jQuery('.topic-loading').show();
e.preventDefault();
var loadUrl = jQuery(this).attr('action');
jQuery.post(
loadUrl,
data,
function(responseText){
jQuery('.reply-topic-form-holder').html(responseText);
jQuery('.alert-success').each(function(){
jQuery('#replytopic-form textarea').each(function(){
jQuery(this).val('');
});
});
jQuery('.topic-loading').hide();
init_reply_topic_js();
}
);
});
}
</script>
보십시오, 나는 질문 - ckeditor에서와 웹 사이트에서 답을 역류하지 않고 데이터를 얻는 방법, 여기 링크입니다 - https://docs.ckeditor.com/ckeditor4/docs/?mobile=/guide/dev_savedata – TimBrownlaw
그게 내 문제 야. 나는이 문제에 관해 혼란 스럽다. 내게 미친 짓을하기 때문에 나는 구글에서 어떻게 검색 할 지 모르겠다..................... 답변에 감사드립니다. –
나는 당신을 줬다. 봐야 할 링크. 너 봤어? – TimBrownlaw