Skip to content

Commit

Permalink
Recaptcha provided getResponse() method
Browse files Browse the repository at this point in the history
  • Loading branch information
kevzlou7979 committed Sep 28, 2018
1 parent 371eff0 commit 612fdc9
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,4 +152,12 @@ public void setType(RecaptchaType type) {
public RecaptchaType getType() {
return type;
}

/**
* Will get the response
* @return
*/
public String getResponse() {
return $this().find("#g-recaptcha-response").val().toString();
}
}

3 comments on commit 612fdc9

@ajakimczukdev
Copy link

@ajakimczukdev ajakimczukdev commented on 612fdc9 Sep 28, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that is cool fix but not working becasue # selector search elements by id but the id of recapcha response is different and depends on how many times was reloaded. First time it is g-recaptcha-response-1 after reload it is g-recaptcha-response-2 and so on and so on...
Please change it to use class selector . i.e. .g-recaptcha-response which seems be constant value or by name selector textarea[name*='g-recaptcha-response'

Below screenshot of generated recapcha response after reloads:

recaptcha_screenshot

@kevzlou7979
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok cool will change it

@kevzlou7979
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok committed the additions

Please sign in to comment.