//鏄剧ず灏嗘埧鍨嬬殑浠锋牸
function AiaxFunction(tr_index, pk_id, bday) {
var obj;
var spanct;
var spanct2;
if (tr_index < 10) {
obj = 'gv_summary_ctl0' + tr_index + '_lbl_price';
spanct = 'span_ct' + tr_index;
spanct2 = 'span_ct2' + tr_index;
} else {
obj = 'gv_summary_ctl' + tr_index + '_lbl_price';
spanct = 'span_ct' + tr_index;
spanct2 = 'span_ct2' + tr_index;
}
var param_url = "day=" + bday + "&tc=" + pk_id;
$.ajax({
type: "POST",
url: "tour_package_overview.ashx",
data: param_url,
beforeSend: function() {
$("#" + obj).html("
");
},
success: function(msg) {
$("#" + obj).html(msg);
}
});
$("#" + spanct).css("display", "none");
$("#" + spanct2).css("display", "");
}
function AiaxFunctioncoles(tr_index) {
var obj;
var spanct;
var spanct2;
if (tr_index < 10) {
obj = 'gv_summary_ctl0' + tr_index + '_lbl_price';
spanct = 'span_ct' + tr_index;
spanct2 = 'span_ct2' + tr_index;
} else {
obj = 'gv_summary_ctl' + tr_index + '_lbl_price';
spanct = 'span_ct' + tr_index;
spanct2 = 'span_ct2' + tr_index;
}
$("#" + obj).html('');
$("#" + spanct).css("display", "");
$("#" + spanct2).css("display", "none");
}
function isEmail(vEMail) {
//鍒ゆ柇鏄惁鏄悎娉曢偖浠跺湴鍧€,鍚堟硶杩斿洖 true, 涓嶅悎娉曡繑鍥?false
var regInvalid = /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/;
var regValid = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/;
return (!regInvalid.test(vEMail) && regValid.test(vEMail));
}
function btnSend() {
if ($('#txtName').val() == '') {
$("#name_error").html("Please input name");
return false;
}
if ($('#txtEmail').val() == '') {
$("#email_error").html('Please input email!');
return false;
}
else {
if (!isEmail($('#txtEmail').val())) {
$("#email_error").html('Email format is error!');
return false;
}
}
if (jQuery.trim($('#textareaQuestion').val().replace(' ', '')) == '' || $('#textareaQuestion').val() == 'please write down your requirement, we will plan and reply to you as soon as possible.') {
$("#question_error").html('Please input enquiry!');
return false;
}
}