0
votes

i am using simple captcha in grails from grails captcha plugin. I need to validate it and this is my captcha code. This is gsp page code.

<img src="${createLink(controller: 'simpleCaptcha', action: 'captcha')}"/> <g:textField class="form-control" name="captcha" placeholder="Type captcha letters here"/>

and this is controller code.

`def simpleCaptchaService

// This is the action that handles the submission of the form with the CAPTCHA def save = { boolean captchaValid = simpleCaptchaService.validateCaptcha(params.captcha) } ` But its not validating this captcha, so please can somebody look into it and help me.

1

1 Answers

0
votes

i got solution for captcha validation in grails. Any one needed can use this `def simpleCaptchaService

def save = { boolean captchaValid = simpleCaptchaService.validateCaptcha(params.captcha) }`

This should be kept in controller you get the result in boolean format i.e true or false get this value and validate it.