admin管理员组文章数量:1326285
I have a Single Page Application (SPA) I would like to add ReCaptcha to. This application is hosted using IIS as flat Html, Css & Javascript, this SPA in turn talks to a separate REST server (using CORS) for all dynamic content.
The REST server is written using ASP WebAPI. The problem is; all examples I have seen of ReCaptcha all use ASP MVC (or other languages) to inject html into the webpage, I cannot modify the webpage using ASP in this manor. Hopefully someone else has had the same problem.
I am really looking for some 2 parts, first the HTML that belongs on the client, and secondly the Controller that would be on the REST Server to verify with google. Even if this is in another language that I can convert, this will be useful!
I have a Single Page Application (SPA) I would like to add ReCaptcha to. This application is hosted using IIS as flat Html, Css & Javascript, this SPA in turn talks to a separate REST server (using CORS) for all dynamic content.
The REST server is written using ASP WebAPI. The problem is; all examples I have seen of ReCaptcha all use ASP MVC (or other languages) to inject html into the webpage, I cannot modify the webpage using ASP in this manor. Hopefully someone else has had the same problem.
I am really looking for some 2 parts, first the HTML that belongs on the client, and secondly the Controller that would be on the REST Server to verify with google. Even if this is in another language that I can convert, this will be useful!
Share Improve this question asked May 22, 2014 at 4:32 Josh McJosh Mc 10.3k8 gold badges56 silver badges68 bronze badges 1- Ofcourse after hours of searching, 10 mins after I submit I find something that may work. Checking out codeproject./Articles/116250/Custom-reCaptcha-Validation. Will post if this works. – Josh Mc Commented May 22, 2014 at 4:39
2 Answers
Reset to default 3Looks like what I wanted was simply to use reCaptcha without plugins (https://developers.google./recaptcha/docs/display)
I have used ngx-captcha with my angular project. Here's how I kept my submit button disabled until recaptcha checkbox is checked.
//code
<ngx-recaptcha2 (success)="handleSuccess($event)" #captchaElem [siteKey]="siteKey" formControlName="recaptcha">
</ngx-recaptcha2>
once captcha is filled , it emits a success event , so use it in a method to make a variable true/false based on which you can enable/disable submit button
本文标签: javascriptHow do I implement ReCaptcha in a Single Page Application (SPA)Stack Overflow
版权声明:本文标题:javascript - How do I implement ReCaptcha in a Single Page Application (SPA) - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742209124a2433375.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论