$(document).ready(function(){
$('#send').click(function() {
var names = $('#appontment_form').serialize();
//this is how my names variable look like
//doctor=Dr.Fathmath+Shahuda&date=2013-02-27&time=1900+-+1700&phone=
var doc = $(names).filter('doctor');
if(doc !='')
{
$.ajax({
type: "post",
url: "../../includes/jqueryRequireFiles/appointmentSave.php",
data:names,
success: function(data)
{
$('#confir').text('Your Appointment Received..');
}
});
return false;
}
});
});
我有一個appontment窗體。當我點擊發送鏈接時,它將獲取文本框中的所有值,並通過serialize()函數將其放入名稱變量中。我要篩選的名稱變量,找出是否有任何的領域留下未填寫。如果只有那麼我會讓阿賈克斯部分..但它不工作...任何幫助使用jquery serialize()函數進行簡單表單驗證
但不使用表單的使用鏈路發送見識到另一個頁面提交button..im IM – 2013-02-27 08:21:11