Is there no Captcha for Forms?

Posted by Community Admin on 03-Aug-2018 15:48

Is there no Captcha for Forms?

All Replies

Posted by Community Admin on 23-Jan-2011 00:00

How do I get a Captcha going on the forms, and\or only allow submissions by registered(logged in) users?

Posted by Community Admin on 23-Jan-2011 00:00

Hey Steve,

First point, a Captcha form widget should exist.  I'll confirm that it's on the roadmap.  From there it's just a matter of scheduling this in the midst of the hundreds of other high-priority items.  :)

Second point, you can add your own custom Form Widgets.  Although, from what I'm seeing, our documentation of this is currently limited to a forum post.  In addition, we also have a Captcha control present in RadControls.  Because RadControls is included with Sitefinity, you could wrap this control in a form widget.

This is all just theory though.  I haven't attempted any of this.  If you're feeling brave, take a stab at it.  Otherwise, I'm sure this will get addressed in a future Q release.

Gabe Sumner
Telerik | Sitefinity CMS

Posted by Community Admin on 23-Jan-2011 00:00

Thanks for the info Gabe...I was actually looking for the RadCaptcha, figured it had to be somewhere

I'll just wait for it to be implemented into the forms engine instead of hacking in my own...I'm waiting on the forms DBtable prefix fix as well, so I'll just try and hold-off on heavy forms use anyway.

Posted by Community Admin on 20-May-2011 00:00

Is this Captcha available in 4.1 sp1?

Thanks,
JH

Posted by Community Admin on 23-May-2011 00:00

Hi JH,

The feature is still not implemented. This Q we are going to extend the forms and we will try to include some validation.

Regards,
Ivan Dimitrov
the Telerik team

Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 15-Jun-2011 00:00

Is there a workaround or code examples on how to create a custom form control with a CAPTCHA in the meantime?  It's really frustrating to see that there was a built in CAPTCHA/honey pot control in 3.x and the best answer I can find for 4.x is "Well, we'll add it to the queue for next quarter."

Posted by Community Admin on 16-Jun-2011 00:00

Hi Liz,

Here is a thread that shows how to create a custom field control. You can use similar approach to add the RadCaptcha.

Kind regards,
Ivan Dimitrov
the Telerik team

Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 07-Sep-2011 00:00

Hi

I tried to use RadCaptcha, Was able to add it to toolbox and Added to to Form. Now question is how to validate it? I created a Custom Form Control inheriting FormControl class and tried to validate in submit click event using captcha.IsValid but once i click submit form shows success message even if i enter wrong text in captcha.

Posted by Community Admin on 08-Sep-2011 00:00

Hi Naveen,

The RadCaptcha validates on postback. It depends at what stage of the ASP.NET page lifecycle you check the IsValid property of the RadCaptcha, because the validation might not have been performed yet. You could try to call RadCaptcha.Validate(), and then Page.Validate().

You can try to set some session value that indicates whether the RadCaptcha is valid which should explicitly validate the control. You can also check Page.IsValid.

Kind regards,
Ivan Dimitrov
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Posted by Community Admin on 08-Sep-2011 00:00

Hi Ivan
Thanks for you reply.

Here is what I am doing in my custom FormControl Submit button click

protected override void ConfigureSubmitButton(System.Web.UI.Control control, string validationGroup)
        
            var submit = control as FormSubmitButton;
            submit.Click += new EventHandler(submit_Click);
            base.ConfigureSubmitButton(control, validationGroup);
        
 
        void submit_Click(object sender, EventArgs e)
        
            Guid formId = this.FormId;
            FormsManager formMgr = new FormsManager();
            FormDescription formDescr = formMgr.GetForm(formId);
 
            if (this.FormControls.FindControl("Body").Controls.OfType<Telerik.Web.UI.RadCaptcha>().Count() > 0)
            
                RadCaptcha captcha = (RadCaptcha)this.FormControls.FindControl("Body").Controls.OfType<Telerik.Web.UI.RadCaptcha>().First();
                captcha.ErrorMessage = "You have entered an invalid code";
                captcha.Validate();
                if (captcha.IsValid)
                
                    var smtpSettings = Config.Get<SystemConfig>().SmtpSettings;
 
                    if (!smtpSettings.Host.IsNullOrWhitespace())
                    
                        using (SmtpClient smtpClient = new SmtpClient(smtpSettings.Host, smtpSettings.Port))
                        
                            smtpClient.Send(
                                "test@gmail.com",
                                "test@gmail.com",
                                "Test",
                                "Test"
                                );
                        
                    
                //It sends a mail if captcha is valid and shows success message which is fine
 
                
                else
                
                    //Now I want to write some code here to cancel Submit and show form to reenter captcha value
                   //and prevent form showing success message
 
                
            
 
 
        

Posted by Community Admin on 09-Sep-2011 00:00

Hi Naveen,

To stop the submit you need to preform Response.Redirect in the code block ( this is the easiest way).

Best wishes,
Ivan Dimitrov
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Posted by Community Admin on 16-Sep-2011 00:00

Thanks Ivan

I Managed to fix it by commenting following line of code.
base.ConfigureSubmitButton(control, validationGroup);

Posted by Community Admin on 11-Oct-2011 00:00

@Ivan

Are we going to see captchas for forms in 4.3 or 4.4?
Are we going to see customized validations lets say for e-mail address in forms?

Markus

Posted by Community Admin on 14-Oct-2011 00:00

Hi Markus,

All the fixes and features for 4.3 release are already planned and Captcha for forms is not amongst them. I will keep you posted when we plan this feature.

Best wishes,
Antoaneta
the Telerik team

Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 14-Oct-2011 00:00

Thanks Antoaneta

Sad to hear we are not getting a captcha functionality anytime soon.

Have a nice weekend.

Markus

This thread is closed