I am using simpleCaptcha library to display captcha using servlet. requirement is to refresh the captcha if refresh button is pressed.
<h:graphicImage value="/img/refresh-s.png" onclick="changeCaptcha()" />
<img id="myCaptcha" src="/RoyalCourtPortal-portlet/simpleImg" width="120" height="30" />
$('myCaptcha').attr('src', '/RoyalCourtPortal-portlet/simpleImg' );
Please while answering provide code example as I am very new with javascirpt.
Thanks in advance
You should consider using Primefaces which has a captcha component built in. Standard JSF without an extension framework is very limited in capabilities and you'll be tempted to reinvent the wheel where that is really not necessary.