Open vgavrilovikj opened 5 years ago
var el = document.getElementById("captcha-img");
el.src = el.src.split('?')[0] + "?_=" + Math.random();
replace captcha-img with an id/selector to your captcha image
<img src="/captcha" onclick="this.src='/captcha?'+Math.random()" alt="captcha" style="cursor: pointer;">
I have a form, on submit button click, with AJAX I am calling the php that sends the mail and once the email is sent the form refreshes, how can I generate a new captcha once the form is sent?