$(function(){ $('#create_hotel').click(function(){ if($('#hotel_name_kr').val() == ""){ alert('hotel name Korea not empty'); return false; }if($('#hotel_name_en').val() == ""){ alert('hotel name Eng not empty'); return false; }if($('#hotel_rating').val() == ""){ alert('please select rating'); return false; }if($('#hotel_build').val() == ""){ alert('hotel build not empty'); return false; }if($('#hotel_room').val() == ""){ alert('hotel room not empty'); return false; }if($('#hotel_address').val() == ""){ alert('hotel address not empty'); return false; }if($('#hotel_province').val() == ""){ alert('please select province'); return false; }if($('#hotel_telephone').val() == ""){ alert('hotel telephone not empty'); return false; }if($('#hotel_url').val() == ""){ alert('hotel url not empty'); return false; } else { $('#result').html('<img src="images/ajax-progress.gif" alt="loader" />').show(); var form = document.add_hotel; var url = $('#add_hotel').attr('action'); $.ajax({ type: 'POST', url: url, dataType: text, async: false, data: $(form).serialize(), success: function(data){ //$('#result').html(data).show(); if(data == 1){ $('#result').html('<div class="success">Create Success</div>').show(); } else { $('#result').html('<div class="error">Create Error</div>').show(); } } }); } return false; }); });
$(document).ready(function() { ใส่ function ตรงนี้ ---- });
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง