-1
Inspect elemet을 사용하는 동안 Ajax를 사용하여 데이터를 게시합니다. 다른 모든 필드의 게시물 데이터를 볼 수 있지만 텍스트 영역 필드가 비어 있으므로 데이터가 저장되지 않습니다. 데이터 베이스.TextArea가 데이터를 전송하지 않습니다. Submit
function addblog() {
save_method = 'add';
url = "<?php echo site_url('index.php/blog/post_new_blog')?>";
$.ajax({
url: url,
type: "POST",
data: $('#addblog').serialize(),
dataType: "json",
success: function (data) {
alert('Saved');
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Error adding/update data');
}
});
}
HTML :
<div id="editor-one" class="editor-wrapper"></div>
<textarea id="descr" class="text" name="desc" style="display:none;"></textarea>
PHP :
public function post_new_blog()
{
$data = array(
'blog_title' => $this->input->post('title', true),
'blog_content' => $this->input->post('desc', true),
'blog_tags' => $this->input->post('tags', true),
);
$insert = $this->main_model->save_new_posts($data);
echo json_encode(array("status" => TRUE));
}
열기/닫기 텍스트 영역 사이에 공백이 없어야합니다. – manian
'style = "가시성 : 숨김; 위치 : 절대;"로 변경하십시오. 그것은 작동해야합니다. 비슷한 질문에 대한보기 (여기에) (http://stackoverflow.com/questions/8318428/submit-form-fields-inside-displaynone-element) – jagad89
'display : none'이있는 필드는 전송되지 않습니다 – RST