Thank you so much, your answer above fixed 1 and 2. For #3 I have put $.magnificPopup.close(); in the view in the if (data.responseJSON.response == ‘success’) {
after displaying the success message
if (($messageSuccess.offset().top – 80) < $(window).scrollTop()) {
$(‘html, body’).animate({
scrollTop: $messageSuccess.offset().top – 80
}, 300);
}
Now on the browser version, it closes as soon as I click the submit button without showing the success message. On the mobile version, it shows the success message but doesn’t closes the popup.
Thanks again for the help
Mehnaz