Can anybody please advise the best way of implementing the following blog "https://youtu.be/hH3iNf52GNU" with this type of contact form - "https://codeshare.co.uk/blog/how-to-add-recaptcha-to-an-mvc-form/". Having issues updating the reCaptcha with the JQuery! Thanks in advance
var contactForm = contactForm ||
{
init: function () {
this.listeners();
},
listeners: function () {
$(document).on('click',
'.contact-submit',
function () {
e.preventDefault();
var form = $("#contact-form");
form.submit();
});
},
showResult: function () {
$('#form-result').hide("slow");
$('#form-result').show('slow');
}
}
So the issue I am facing is updating the google captcha to inform the user that it is either incomplete or incorrect. However, it appears that returning the CurrentUmbracoPage(); in the controller is not working inside the partial view ajax.
Any ideas would be much appreciated thanks. (apologies for formatting of code)
Integrating Ajax jQuery with Google Recaptcha
Can anybody please advise the best way of implementing the following blog "https://youtu.be/hH3iNf52GNU" with this type of contact form - "https://codeshare.co.uk/blog/how-to-add-recaptcha-to-an-mvc-form/". Having issues updating the reCaptcha with the JQuery! Thanks in advance
Hi Daniel
Can you post your code? What the issue exactly is?
Thanks,
Alex
Hi Alex, thanks for getting back to me on this.
Here is my controller method:
public ActionResult SubmitForm(ContactViewModel model) { bool success = false;
Followed by my partial view:
FInally, my js file:
var contactForm = contactForm || { init: function () { this.listeners(); }, listeners: function () { $(document).on('click', '.contact-submit', function () { e.preventDefault(); var form = $("#contact-form"); form.submit(); }); }, showResult: function () { $('#form-result').hide("slow"); $('#form-result').show('slow'); } }
So the issue I am facing is updating the google captcha to inform the user that it is either incomplete or incorrect. However, it appears that returning the CurrentUmbracoPage(); in the controller is not working inside the partial view ajax.
Any ideas would be much appreciated thanks. (apologies for formatting of code)
is working on a reply...