預(yù)約設(shè)計(jì)
$(".formksbj_submit").click(function(){
var typeid = $(".formksbj_typeid").val();
var username = $(".formksbj_username").val();
var tel = $(".formksbj_tel").val();
var fangxing = $(".formksbj_fangxing").val();
var area = $(".formksbj_area").val();
var url = "/Public/addappform.html";
if(username==""){
alert("請(qǐng)輸入您的姓名!");
$(".formksbj_username").focus();
return false;
}
if(tel==""){
alert("請(qǐng)輸入您的手機(jī)號(hào)!");
$(".formksbj_tel").focus();
return false;
}else{
var testtel = /^(0[0-9]{2,3}-)?[0-9]{7,8}$/;
var testStr=/^0?(13[0-9]|14[0-9]|15[0-9]|16[0-9]|17[0-9]|18[0-9]|19[0-9])[0-9]{8}$/;
if(!testStr.test(tel) && !testtel.test(tel) ){
alert("請(qǐng)?zhí)顚懻_的電話號(hào)碼!");
return false;
}
}
var form_data = {
"typeid":typeid,
"username":username,
"tel":tel,
"fangxing":fangxing,
"area":area
}
$.ajax({
url:url,
data:form_data,
type:'POST',
success: function (data){
if(data.status==1){
alert("您已提交成功,稍后在線客服將會(huì)和您聯(lián)系。謝謝!");
$(".formksbj_username").val("");
$(".formksbj_tel").val("");
$(".formksbj_area").val("");
}else {
alert("請(qǐng)重新提交!");
alert(data.text);
}
}
})
});
$(".formyuey_submit").click(function(){
var typeid = $(".formyuey_typeid").val();
var username = $(".formyuey_username").val();
var tel = $(".formyuey_tel").val();
var url = "/Public/addappform.html";
if(username==""){
alert("請(qǐng)輸入您的姓名!");
$(".formyuey_username").focus();
return false;
}
if(tel==""){
alert("請(qǐng)輸入您的手機(jī)號(hào)!");
$(".formyuey_tel").focus();
return false;
}else{
var testtel = /^(0[0-9]{2,3}-)?[0-9]{7,8}$/;
var testStr=/^0?(13[0-9]|14[0-9]|15[0-9]|16[0-9]|17[0-9]|18[0-9]|19[0-9])[0-9]{8}$/;
if(!testStr.test(tel) && !testtel.test(tel) ){
alert("請(qǐng)?zhí)顚懻_的電話號(hào)碼!");
return false;
}
}
var form_data = {
"typeid":typeid,
"username":username,
"tel":tel
}
$.ajax({
url:url,
data:form_data,
type:'POST',
success: function (data){
if(data.status==1){
alert("您已提交成功,稍后在線客服將會(huì)和您聯(lián)系。謝謝!");
$(".formyuey_username").val("");
$(".formyuey_tel").val("");
}else {
alert("請(qǐng)重新提交!");
alert(data.text);
}
}
})
});