0
如何驗證與jQuery驗證插件CKEDITOR。驗證CKEditor的使用jQuery驗證插件
這是我的代碼
<script type="text/javascript">
$(document).ready(function(){
$("#newpost").validate({
debug: false,
rules: {
title: "required",
cat_id: "required",
editor1:"required"
},
messages: {
title: " Title name cannot be blank.",
cat_id: " Please select a category.",
editor1: " Post keywords cannot be blank."
},
submitHandler: function(form) {
// do other stuff for a valid form
$.post('new_post.php', $("#newpost").serialize(), function(data) {
$('#msgw').html(data);
});
}
});
});
</script>
PHP代碼:
<?php
include ('../db.php');
$title = mysql_real_escape_string($_POST['title']);
$editor1 = $_POST['editor1'];
$date= date("Y-m-d");
$cat_id = mysql_real_escape_string($_POST['cat_id']);
$qu = mysql_query("INSERT INTO blogposts(title,post,date,catid)VALUES ('".$title."','".$editor1."','".$date."','".$cat_id."')") or die (mysql_error());
?>
問題是,它dosent甚至張貼包含在編輯器中。我該如何解決這個問題。謝謝。
爲某些非常相似(或相同)的問題勾選「相關」列 – 2012-01-05 14:28:15
CKEditor將更改「TextArea」的界面。您仍然可以檢查「TextArea」內容。關於內容傳遞,請確保您設置表單發送方法,當然還有「TextArea」的名稱。 – MahanGM 2012-01-05 18:07:53