update for form.leasing.nomail component for recaptcha
This commit is contained in:
parent
b828755b68
commit
c42c1cb69d
@ -56,6 +56,12 @@ function form_leasing_request_submit()
|
||||
formData.append("FORM_FIELD_TERM", $("#FORM_FIELD_TERM").val() ? $("#FORM_FIELD_TERM").val() : "");
|
||||
formData.append("FORM_FIELD_REDEMPTION", $("#FORM_FIELD_REDEMPTION").val() ? $("#FORM_FIELD_REDEMPTION").val() : "");
|
||||
|
||||
grecaptcha.ready(function()
|
||||
{
|
||||
grecaptcha.execute($("meta[name=recaptcha_site_key]").attr("content"), { action: 'submit' }).then(function(token)
|
||||
{
|
||||
formData.append("recaptcha_token", token);
|
||||
|
||||
$.ajax(
|
||||
{
|
||||
url: "/api/forms/", type: 'POST', success: function(response)
|
||||
@ -76,13 +82,22 @@ function form_leasing_request_submit()
|
||||
{
|
||||
$("#form_leasing_request").find("*[name="+response.errors[i]+"]").addClass("error");
|
||||
|
||||
leasing_form_submitting = false;
|
||||
}
|
||||
|
||||
$("#form_leasing_process").css("display","none");
|
||||
$("#form_leasing_fail").css("display","flex").parent().css("backgroundColor", "#2C2D2E");
|
||||
|
||||
$("#send_button_text").css("display", "block");
|
||||
$("#send_button_spinner").css("display", "none");
|
||||
|
||||
leasing_form_submitting = false;
|
||||
}
|
||||
}, data: formData,
|
||||
dataType: "json",
|
||||
cache: false, contentType: false, processData: false
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -84,6 +84,9 @@ $this->setFrameMode(true);
|
||||
<div id="form_leasing_success" style="min-height: 400px; align-items: center; justify-content: center; display: none;">
|
||||
<p style="color: #fff; font-size: 24px; line-height: 34px;">Благодарим Вас за обращение, наши специалисты свяжутся с Вами в ближайшее время.</p>
|
||||
</div>
|
||||
<div id="form_leasing_fail" style="background-color: #2C2D2E; min-height: 400px; align-items: center; justify-content: center; display: none;">
|
||||
<p style="color: #fff; font-size: 24px; line-height: 34px;">Сожалеем, запросы, отправляемые с Вашего устройства похожи на автоматические. Пожалуйста, воспользуйтесь другим браузером/подключением или попробуйте позднее.</p>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user