Hello
How can I show or hide a multifield if when entering a date more than 18 years have passedthank you
Please write a review for the extension you are using on the Joomla extensions directory before posting a new question as we are being spammed by many negative reviews.
Thank you for your support!
Hello
How can I show or hide a multifield if when entering a date more than 18 years have passedthank you
function getEdad(dateString) {where xxx its the name of the Multi field
let hoy = new Date()
let fechaNacimiento = new Date(dateString)
let edad = hoy.getFullYear() - fechaNacimiento.getFullYear()
let diferenciaMeses = hoy.getMonth() - fechaNacimiento.getMonth()
if ( diferenciaMeses < 0 || (diferenciaMeses === 0 && hoy.getDate() < fechaNacimiento.getDate())) {
edad--
}
if (edad < 18) {
$("#xxx").show();
} else {
$("#xxx").hide();
$("#text_6").val("");
}
return true;
}
2CheckOut.com Inc. (Ohio, USA) is an authorized retailer for goods and services provided by ChronoEngine.com