';
$(".alert-danger").remove();
$('form.reg-form-data').before(message);
//$('.alert').fadeOut(4000);
},
complete: function () {
$("#LoadingBar").hide();
$("input[type=submit]").attr('disabled', false);
}
});
// }
return false
});
setTimeout(function () {
var pmnt_fld_name = $('.pmnt_fld').attr('name');
if (pmnt_fld_name) {
var symbol = $("select[name=" + pmnt_fld_name + "]").find(':selected').attr('data-symbol');
if (symbol) {
console.log(symbol);
var id = pmnt_fld_name.substr(pmnt_fld_name.length - 5);
id = id.replace('_', '');
id = id.replace('d', '');
id = id.replace('l', '');
// console.log(id);
$("#fld_" + id + " > option").each(function () {
var dataprice = $(this).attr('data-price');
if (dataprice) {
$(this).text(dataprice + '' + symbol);
}
});
}
}
}, 1000);
$("input[type=radio], select").on('change', function () {
var elementName = $(this).attr('name');
var elementValue = $(this).val();
var id = elementName.substr(elementName.length - 5);
if (elementName.indexOf("pmnt_fld") >= 0) {
id = id.replace('_', '');
id = id.replace('d', '');
id = id.replace('l', '');
// console.log(ild);
// console.log('yes');
if (elementValue != '') {
var symbol = $(this).find(':selected').attr('data-symbol');
$("#fld_" + id + " > option").each(function () {
var dataprice = $(this).attr('data-price');
if (dataprice) {
$(this).text(dataprice + '' + symbol);
}
// console.log(this.text + ' ' + this.value+ ' '+ dataprice);
});
} else {
$("#fld_" + id + " > option").each(function () {
var dataprice = $(this).attr('data-price');
$(this).text(dataprice)
});
}
} else {
// console.log('no');
}
var otherElementName = elementName.replace('[]', '_other');
// console.log(elementValue);
// if ($("#" + otherElementName).length == 0) {
// return true;
// }
if ($.isArray(elementValue)) {
} else {
if (elementValue && elementValue.toLowerCase() == 'other') {
$("#group_" + otherElementName).show();
} else {
$("#group_" + otherElementName).hide();
// $("#"+otherElementName).val('');
}
}
});
if (window.location.href.indexOf("saregistration.sport/en/form/editProfileV2") = checkOutDate) {
console.log("if");
$("#fld_1304372").val('');
if ($(".error-message-dateDif").length === 0 && checkInDate >= checkOutDate) {
console.log("if2");
//var errorMessage = $('').attr('class', 'error-message-dateDif').text('Checkout date must be greater than check-in date').css('color', 'red');
var errorMessage = 'Checkout date must be greater than check-in date';
//$(".error-message-dateDif").show();
console.log(errorMessage);
$("#grp_fld_1304372 .text-danger").text('Checkout date must be greater than check-in date');
return false;
}
return false;
}
else if (checkInDate ').attr('class', 'error-message-dateDif').text('').css('color', 'red');
$("#fld_1304372").after(errorMessage);
$("#grp_fld_1304372 .text-danger").text('');
}
*/
console.log("inside the days diff")
var checkInDate = $("#fld_1304371").val();
var checkOutDate = $("#fld_1304372").val();
if (checkInDate && checkOutDate) {
/*var startDate = new Date(checkInDate);
var endDate = new Date(checkOutDate);
var timeDifference = Math.abs(endDate.getTime() - startDate.getTime());
var daysDifference = Math.ceil(timeDifference / (1000 * 3600 * 24));*/
// Split the date string into day, month, and year
var checkInParts = checkInDate.split('/');
var checkOutParts = checkOutDate.split('/');
// Create a new Date object using the correct format (MM/DD/YYYY)
var startDate = new Date(checkInParts[2], checkInParts[1] - 1, checkInParts[0]);
var endDate = new Date(checkOutParts[2], checkOutParts[1] - 1, checkOutParts[0]);
// Calculate the time difference
var timeDifference = Math.abs(endDate.getTime() - startDate.getTime());
// Convert time difference to days
var daysDifference = Math.ceil(timeDifference / (1000 * 3600 * 24));
var tDifference = endDate.getTime() - startDate.getTime();
console.log(tDifference);
$("#grp_fld_1304372 .text-danger").text('');
if (tDifference No. of nights to be reserved:
").insertAfter("#grp_fld_1304372");
}
//////////////////////////////////////////////////////////4,5,13,14 days checks//////////////////////////////////////////////////////
if (shoulderdatesNew.includes(parseInt($('#fld_1304368').val()))) {
var allDates = [];
if ($('#shoulderapril4').is(':checked')) {
$('#shoulderapril4').trigger('click');
}
if ($('#shoulderapril5').is(':checked')) {
$('#shoulderapril5').trigger('click');
}
if ($('#shoulderapril13').is(':checked')) {
$('#shoulderapril13').trigger('click');
}
if ($('#shoulderapril14').is(':checked')) {
$('#shoulderapril14').trigger('click');
}
//for (var i = 1; i Packages Included: ';
var price = 0;
var flag = 0;
var symbol = $('.pmnt_fld option:selected').data('symbol');
if (typeof symbol == "undefined") {
symbol = '';
}
selected += "
');
}
}
});
}
})
var handleResult = function (result) {
if (result.error) {
alert(result.error.message);
}
};
function paymentRedirectionMessage(message)
{
var messageDiv = '
' + message + '
';
$('form.reg-form-data').before(messageDiv);
$("html, body").animate({scrollTop: 0}, "slow");
}
function paymentRedirectionErrorMessage()
{
$(".success-message").hide();
const message = 'Some thing went wrong while redirecting you to payment please contact event admin.';
var messageDiv = '