$(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;
}
});
});
我有一个预约表格。当我单击发送链接时,它将获取文本框中的所有值并通过 serialize() 函数将其放入名称变量中。我想过滤名称变量并找出是否有任何字段未填充..如果只有这样我将制作 ajax 部分..但它不起作用...任何帮助