4 Replies Latest reply on Aug 2, 2007 1:07 AM by gavin.king

    Shouldn't captcha.validate also clear response?

    henrik.lindberg

      In Captcha.java, in this method:

       public boolean validateResponse(String response)
       {
       boolean valid = CaptchaImage.instance().validateResponse(id, response);
       if (!valid)
       {
       init();
       }
       return valid;
       }
      

      it calls init() to generate a new image (which is good), but it does not reset the response value. End result is that user gets a new image, but the old (invalid) text that was entered. So the first thing the user has to do is clear the field. Getting the old response again is useless for the user.

      Think it should do:
      if(!valid)
      {
      this.response = "";
      init();
      }
      

      or do you have some other suggestion how to get the response cleared when it is invalid.