Developer forum

Forum » CMS - Standard features » Another reCaptcha

Another reCaptcha

Ivan Marijanović
Ivan Marijanović
Reply

I have request from client to implement reCaptcha!

I now there was threads about it and that it is not recommended but the client wants it. I also saw the Nicolais post (https://doc.dynamicweb.com/forum/templates/templates/human-verifier-in-forms) with example of listener but I cannot make it work since wea re running latest DW and latest Rapido and Notifications.Standard.Application.BeginRequest is not available.

 

Ivan


Replies

 
Nicolai Pedersen
Reply

Hi Ivan

We will not make capthcas build into Dynamicweb. Do you have an actual problem on this site - I would like to see what that problem is - maybe there is a solution for it.

Begin request is available - no difference on a Rapido compared to other solutions: https://doc.dynamicweb.com/api-docs#article=b88a88b7-eb57-5493-682b-2d36f3d917f9

 

 
Ivan Marijanović
Ivan Marijanović
Reply

I implemented Captcha widget on page. Its here: http://www.heraldi.hr/sign-up?NewsletterEmail=

Now I am trying to implement background check! I wouldlike for button to be initial disabled and to enable it when captcha was successful but it seems it cannot work that way!

I was trying to convert your code to c# and could not get reference but it is becose now it should be BeforeBeginRequest and not BeginRequest.

 

Is it possible to create dll and call object method from javascript so that I validate recaptcha and enable button or I have to use notification subscriber?

Ivan

 
Nicolai Pedersen
Reply

Hi Ivan

No - that is not possible to call c# from javascript. I am sure, that is not how it should work. But I do not know how to implement reCaptcha.

 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi Ivan,

 

If you want to get creative you can do this:

  • JS request triggers an AJAX call to a feed (page with a template)
  • The template requests a method (C#) that return a JSON object with the response
  • JS then processes the AJAX request, which was generated by the C# method

 

We've done this a few times, but it's very discoverable. Not sure if that's acceptable for your case.

 

Best Regards,

Nuno Aguiar

 
Ivan Marijanović
Ivan Marijanović
Reply

Hi Nuno

Can you tell me how to triget template call to c# method.

I think this could be solution.

 

Ivan

 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi Ivan,

 

It's just a page with the Json layout template from Rapido, then create a new paragraph template where you simply request the method as such

@inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel>
@{
    @MyNamespace.MyClass.MyMethod()
}

 

In this case MyMethod() is already returning a Json string, but if it isn't you need to do that in this template.

 

Best Regards,

Nuno Aguiar

 
Ivan Marijanović
Ivan Marijanović
Reply

Thank you Nuno!

Ivan

 

You must be logged in to post in the forum