appleboy / appleboy/react-recaptcha
How do I get the response from Inside my class
- Dominant language
- JavaScript
- Stars
- 643
- Forks
- 96
- PR merge metrics
- No merged PRs in 30d
Description
Basically I'm trying to validate the response from inside my _onSubmit() function is this possible I've tried moving the callback function inside the class so i could use setState or something but Recaptcha fails to locate the function if i put it inside the class.
I'm thinking maybe the better idea is to probably is to check the validation server side right? I'm probably implementing recaptcha wrong trying to handle everything client side?
```
class ContactForm extends React.Component{
constructor(){
super();
this._onSubmit = this._onSubmit.bind(this);
}
_onSubmit(e){
//I WANT TO VALIDATE THE RESPONSE HERE
}
render(){
return(
Submit
);
}
}
let captchaReturn = function(response){
if(response.length === 0){
alert("no");
}
else {
document.getElementById("myBtn").disabled = false;
}
}
let onloadCallback = function() {
}
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.