Closed pishguy closed 9 years ago
Using jquery or zepto.js to bind click event .
yes i know that, but i can not change that. i dont know how to change, please help me to use this useful package. thanks
$('#captcha').click(function(){
$('#captcha').attr('src','/captcha/default?'+Math.random());
});
Thanks. after click on captcha, thats set to hide and don't work correctly
Thanks sir. after click on CAPTCHA, image hide and dont refresh, thanks to reply
Route::get('/get_captcha/{config?}', function (\Mews\Captcha\Captcha $captcha, $config = 'default') {
return $captcha->src($config);
});
<img src="{{ captcha_src() }}" alt="captcha" class="captcha-img" data-refresh-config="default">
$('img.captcha-img').on('click', function () {
var captcha = $(this);
var config = captcha.data('refresh-config');
$.ajax({
method: 'GET',
url: '/get_captcha/' + config,
}).done(function (response) {
captcha.prop('src', response);
});
});
Captcha image click to refresh.
I try to do that but it's not working sorry about my enlish
<img src="{{captcha_src()}}" onclick="this.src='/captcha/default?'+Math.random()" id="captchaCode" alt="" class="captcha">
<a rel="nofollow" href="javascript:;" onclick="document.getElementById('captchaCode').src='captcha/default?'+Math.random()" class="refresh">refresh</a>
Hope to be helpful.
Thank you so much for reply It works ^ ^
Sorry to ask again, how to do multiple recaptcha on same page
thank you KeepChen
Thank you @keepchen
@keepchen After searching in many discussions and tutorials, this method is great. Thank you, sir!
i'm using this bundle in laravel 4, but i can not refresh captcha image by click on refresh icon