anhskohbo / no-captcha

No CAPTCHA reCAPTCHA For Laravel.
https://packagist.org/packages/anhskohbo/no-captcha
MIT License
1.76k stars 235 forks source link

ajax submit #72

Open Alexrubl opened 7 years ago

Alexrubl commented 7 years ago

And how with ajax it all to use? Writes that reCaptcha ID empty. I need to add ajax to submit

emtized commented 6 years ago

@Alexrubl You Can use captcha: grecaptcha.getResponse(), in your ajax submit data and then get captcha data

lukaszog commented 6 years ago

How to validate them?

emtized commented 6 years ago

@lukaszog You want to validate google captcha throw ajax ? it depends on witch framework that you use ? i used this package in laravel

lukaszog commented 6 years ago

No, I would like to validate captcha using laravel 5 when cpatcha is sending by ajax using captcha: grecaptcha.getResponse()

emtized commented 6 years ago

@lukaszog you have to write validation rule inside your laravel Request like : return Validator::make($data, [ 'g-recaptcha-response' => 'required|captcha',

mkantautas commented 6 years ago

@emtized Note: if you're sending captcha: grecaptcha.getResponse() ,then on server side you should also be looking for return Validator::make($data, [ 'captcha' => 'required|captcha', , not 'g-recaptcha-response

emtized commented 6 years ago

@emtized Note: if you're sending captcha: grecaptcha.getResponse() ,then on server side you should also be looking for return Validator::make($data, [ 'captcha' => 'required|captcha', , not 'g-recaptcha-response

@neorganic Yes you're right id depends on your code , i just sent my info with this name in Ajax Thanks dude