SOLICITUD DE CERTIFICADO DE VIAJE

ATENCIÓN AL CLIENTE

    Tipo de certificado*
    Selecciona tipo de tarjeta o QR*

    Datos del titular de la tarjeta o solicitante

    Nombre*
    Apellidos*
    DNI/NIE/CIF*

    Dirección

    Calle*
    Número / Piso / Letra*

    Ciudad*
    Provincia*
    Código postal*

    Datos adicionales

    Email* En caso de QR, indicar el email asociado al mismo
    Número de tarjeta* En caso de que tenga 9 dígitos añade un 0 al inicio
    Fecha inicio*
    Fecha fin*

    Firma*

    document.querySelector('.wpcf7-form').addEventListener('submit', function(event) { // Obtener el valor del campo de fecha var fechaInicio = document.querySelector('[name="fecha-inicio"]').value; // Validar la fecha if (!isValidDate(fechaInicio)) { alert('Por favor ingrese una fecha válida en el formato DD-MM-YYYY para la fecha de inicio.'); event.preventDefault(); // Evitar que el formulario se envíe si la validación falla } // Obtener el valor del campo de fecha var fechaFin = document.querySelector('[name="fecha-fin"]').value; // Validar la fecha if (!isValidDate(fechaFin)) { alert('Por favor ingrese una fecha válida en el formato DD-MM-YYYY para la fecha de fin.'); event.preventDefault(); // Evitar que el formulario se envíe si la validación falla } }); function isValidDate(dateString) { // Expresión regular para verificar el formato DD-MM-YYYY var regex = /^\d{4}-\d{2}-\d{2}$/; // Verificar si la cadena coincide con el formato DD-MM-YYYY y si es una fecha válida if (regex.test(dateString)) { var parts = dateString.split("-"); var year = parseInt(parts[0], 10); var month = parseInt(parts[1], 10); var day = parseInt(parts[2], 10); var date = new Date(year, month - 1, day); return date.getFullYear() === year && date.getMonth() + 1 === month && date.getDate() === day; } else { return false; } }