Compartilhe sua experiência e ajude outros hóspedes a tomar decisões informadas
A1 Apartments Aruba - Comfortable B&B Experience in Aruba
below).
const recaptchaSiteKey = "6Ldq-YctAAAAAB2jAlPOq8j9u3pyEUhxEh-KZ6hb";
let recaptchaDone = false;
$('#reviewForm').on('submit', function(e) {
const rating = $('input[name="rating"]:checked').length;
const reviewText = $('#review_text').val();
if (!rating) {
e.preventDefault();
alert('Por favor, selecione uma avaliação');
return false;
}
if (reviewText.length < 20) {
e.preventDefault();
alert('Por favor, escreva pelo menos 20 caracteres para sua avaliação');
return false;
}
// reCAPTCHA v3: fetch a fresh token, drop it in the hidden field,
// then resubmit for real. recaptchaDone guards against re-entry.
if (recaptchaSiteKey && !recaptchaDone && typeof grecaptcha !== 'undefined') {
e.preventDefault();
const form = this;
const $btn = $(form).find('button[type="submit"]').prop('disabled', true);
grecaptcha.ready(function() {
grecaptcha.execute(recaptchaSiteKey, { action: 'submit_review' })
.then(function(token) {
$('#recaptchaToken').val(token);
recaptchaDone = true;
form.submit();
})
.catch(function() {
// If the token can't be fetched, submit anyway and
// let the server decide (it fails open on outages).
recaptchaDone = true;
$btn.prop('disabled', false);
form.submit();
});
});
return false;
}
});
}
// Initialize all components
initStarRating();
initCharacterCounter();
initFormValidation();
});
});
Cookie Consent
We use cookies to enhance your browsing experience, analyze site traffic, and personalize content. By clicking "Accept All", you consent to our use of cookies. You can customize your preferences or learn more in our Cookie Policy.