You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
95 lines
2.8 KiB
JavaScript
95 lines
2.8 KiB
JavaScript
// JavaScript Document
|
|
$(function(){
|
|
$('.othercont').hide();
|
|
$('input[name="ship"]').click(function(){
|
|
$('input[name="othershipcont"]').hide();
|
|
});
|
|
$('input.other[type="radio"]').click(function(){
|
|
$('input[name="othershipcont"]').show();
|
|
});
|
|
$('input.other[type="checkbox"]').click(function(){
|
|
$('input[name="othercitycont"]').toggle();
|
|
});
|
|
$('.cruiseTour:not(:first)').hide();
|
|
c_obj = $('#whichCruise ul li a');
|
|
c_obj.click(function(){
|
|
$('.cruiseTour').hide();
|
|
var mao = $(this).attr('href').replace('#','');
|
|
$('a[name="' + mao +'"]').parent('h2').parent('.cruiseTour').show();
|
|
c_obj.removeClass('active');
|
|
$(this).addClass('active');
|
|
})
|
|
|
|
$('#js_nextsteps').click(function(){
|
|
var errnum = 0;
|
|
var ship = $('input[name="ship"]:checked').val();
|
|
if( typeof(ship) == "undefined"){
|
|
errnum ++;
|
|
console.log($('input[name="ship"]').parent().parent());
|
|
$('input[name="ship"]').parent().parent('.chrequire').addClass('required');
|
|
}else{
|
|
if(ship == 'other'){
|
|
var otherval = $('input[name="othershipcont"]').val();
|
|
if( otherval == ""){
|
|
errnum++;
|
|
$('input[name="ship"]').parent().parent('.chrequire').addClass('required');
|
|
}
|
|
}
|
|
}
|
|
|
|
var Transfer = $('input[name="cityname"]:checked').val();
|
|
if( typeof(Transfer) == "undefined"){
|
|
errnum ++;
|
|
$('input[name="cityname"]').parent().parent('.chrequire').addClass('required');
|
|
}else{
|
|
if(Transfer == 'other'){
|
|
var otherval = $('input[name="othercitycont"]').val();
|
|
if( otherval == ""){
|
|
errnum++;
|
|
$('input[name="cityname"]').parent().parent('.chrequire').addClass('required');
|
|
}
|
|
}
|
|
}
|
|
var adultNum = $('#AdultsNumber').val();
|
|
var ChildNum = $('#ChildNum').val();
|
|
if(isNaN(adultNum) || isNaN(ChildNum)){
|
|
errnum++;
|
|
$('#people').addClass('required');
|
|
}
|
|
if($('#Aquestion').val() == ''){
|
|
errnum++;
|
|
$('#Aquestion').addClass('required');
|
|
}
|
|
if($('#realname').val() == ''){
|
|
errnum++;
|
|
$('#realname').addClass('required');
|
|
}
|
|
if($('#yemail').val() == ''){
|
|
errnum++;
|
|
$('#yemail').addClass('required');
|
|
}
|
|
/*
|
|
if($('#PhoneNo').val() == ''){
|
|
errnum++;
|
|
$('#PhoneNo').addClass('required');
|
|
}*/
|
|
if(errnum>0){
|
|
return false;
|
|
}
|
|
});
|
|
$('#simpletailor input[type="radio"],#simpletailor input[type="checkbox"]').click(function(){
|
|
$(this).parent().parent().removeClass('required');
|
|
});
|
|
$('#simpletailor select').click(function(){
|
|
$(this).parent().removeClass('required');
|
|
});
|
|
$('#simpletailor textarea, #simpletailor input[type="text"]').focus(function(){
|
|
$(this).removeClass('required');
|
|
})
|
|
|
|
if(/AppleWebKit.*Mobile/i.test(navigator.userAgent)|| /Android/i.test(navigator.userAgent) || /Mobile/i.test(navigator.userAgent)){
|
|
$('<input type="hidden" value="chtmoblie" name="chtmoblie">').appendTo('#simpletailor');
|
|
}
|
|
|
|
});
|