|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
aidendoyle1981 Smarty Rookie
Joined: 11 Jan 2016 Posts: 9
|
Posted: Sun Jan 31, 2016 8:21 pm Post subject: Add refesh button on captcha |
|
|
Hi all i have the following code that shows a captcha image. The problem is it does not show a refresh button it only refreshes when the image is clicked. How do I add a button that will refresh the image.
Code: | <img id="{if $captcha_id}{$captcha_id}_{/if}security_img" class="{if $captcha_id}{$captcha_id}_{/if}security_img" alt="{$lang.click_refresh}" title="{$lang.click_refresh}" src="{$smarty.const.RL_LIBS_URL}kcaptcha/getImage.php?{$smarty.server.REQUEST_TIME}{if $captcha_id}&id={$captcha_id}{/if}" style="cursor: pointer;" onclick="$(this).attr('src','{$smarty.const.RL_LIBS_URL}kcaptcha/getImage.php?'+Math.random(){if $captcha_id}+'&id={$captcha_id}'{/if});" /> |
|
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Mon Feb 01, 2016 4:49 pm Post subject: |
|
|
Probably the easiest thing to do is create a button and when onclick happens just call onclick() on the image. Or you could wrap a <div> around the img and new button and apply onclick() to that, but you will have to adjust the call. This is a javascript issue, not really anything related to the underlying smarty templates. |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|