|
 |
|
ใช้ jquery ajaxForm แล้วไม่มารถดึง value ใน textarea ที่เป็น CKeditor ได้ครับ |
|
 |
|
|
 |
 |
|
Code (Java)
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.form.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('#loading')
.ajaxStart(function(){
$(this).show();
})
.ajaxComplete(function(){
$(this).hide();
});
var option = {
beforeSubmit: showRequest,
success: showResponse,
url: 'room_update.php',
clearForm: true
};
$('#add_hotel').submit(function(){
$(this).ajaxSubmit(option);
return false;
});
}); //end dom Jqry
function showRequest(formData, jqForm, options){
var hotel_img = document.getElementById('hotel_img').value;
if (hotel_img == "") {
alert('Please Insert Hotel Img');
return false;
}
return true;
}
function showResponse(data){
if (data == 1) {
$('#result').html('<div class="success">Create Success</div>').show();
} else {
//$('#result').html('<div class="error">Create Error</div>').show();
$('#result').html(data).show();
}
}
</script>
Code (PHP)
<textarea name="hotel_information" id="hotel_information"> </textarea>
<script type="text/javascript">
//<![CDATA[
CKEDITOR.replace( 'hotel_information',{
language : 'en',
skin : 'office2003',
height : 200,
width: 890,
toolbar : 'Full',
filebrowserBrowseUrl : 'ckfinder/ckfinder.html',
filebrowserImageBrowseUrl : 'ckfinder/ckfinder.html?Type=Images',
filebrowserFlashBrowseUrl : 'ckfinder/ckfinder.html?Type=Flash',
filebrowserUploadUrl : 'ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files',
filebrowserImageUploadUrl : 'ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images',
filebrowserFlashUploadUrl : 'ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash'
} );
//]]>
</script>
ajax ทำงานได้ปกติครับ แต่ value ในส่วนที่เป็น Ck เป็นค่าว่างหมดเลยครับ
Tag : PHP

|
|
 |
 |
 |
 |
Date :
2012-10-26 20:08:48 |
By :
Necrotorture |
View :
1477 |
Reply :
1 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
|
|

|
Load balance : Server 01
|