Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to refresh captcha without full page refresh

Sardar NaleDec 20 2012 — edited Dec 20 2012
Hi,
I am using simple captcha implementation using the following link.
[http://www.oracle.com/technetwork/developer-tools/jdev/captcha-099103.html|http://www.oracle.com/technetwork/developer-tools/jdev/captcha-099103.html]

Captcha image refreshes page reload but if i set partialSubmit=true It does not changes the image of the servlet . What is the way to refresh image .
           <af:image  id="iCaptcha"      
                                        source="/captchaservlet"
                                        inlineStyle="width:122px; height:49.0px;"
                                        partialTriggers="cil2"
                                        binding="#{AfProMSDSSearchAction.captchaImage}"/>
When I reset the image source by reseting it by javascript it does not refreshes .
  <af:resource type="javascript">
          function loadCaptchaImage() {           
            var captchaURL = "/captchaservlet?rand=" + Math.random();            
            parent.document.getElementById("pt1:s12:iCaptcha").src=captchaURL;
          }
        </af:resource> 
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 17 2013
Added on Dec 20 2012
2 comments
1,467 views