document.addEventListener('DOMContentLoaded', function(e) { LoginRegistration.initComponents(); formulariotab1 = FormValidation.formValidation( document.getElementById('formulario'), { locale: 'es_ES', localization: FormValidation.locales.es_ES, fields: { tipodocumento: { validators: { notEmpty: { message: 'Required field'} } }, documento: { validators: { notEmpty: { message: 'Required field'}, stringLength: { max: 15, message: 'The document number must contain a maximum of 15 characters.' }, regexp: {regexp: /^[a-zA-Z0-9]+$/i, message: 'Only letters and numbers are allowed in this field.'} } }, paisdocumento: { validators: { notEmpty: { message: 'Required field'} } } }, plugins: { trigger: new FormValidation.plugins.Trigger(), submitButton: new FormValidation.plugins.SubmitButton(), bootstrap: new FormValidation.plugins.Bootstrap(), defaultSubmit: new FormValidation.plugins.DefaultSubmit(), icon: new FormValidation.plugins.Icon({ valid: 'fa fa-check', invalid: 'fa fa-times', validating: 'fa fa-refresh' }), recaptcha: new FormValidation.plugins.Recaptcha({ element: 'captchaContainer', message: 'The captcha is not valid', language: 'en', siteKey: '6LeisN8UAAAAALhk8mY6vmmWooh8tTDqDGrayDhV', theme: 'light', }), } } ) .on('core.form.valid', function() { var form = $('#formulario'); var btn1 = $('.btn-ingreso'); var btn2 = $('.btn-ingreso'); formsubmitnew(form, btn1, btn2); }); $('#paisdocumento').change(function () { var pais = $(this).find(':selected').val(); var tipo = "PREG"; $.get('TipoDocumentoServlet', { gradoNombre: tipo, paisNombre: pais }, function (jsonResponse) { var select = $("#tipodocumento"); select.find('option').remove(); $.each(jsonResponse, function (index, value) { var datos = value.split('*-*'); var id = datos[0]; var nombre = datos[1]; $('