Is there no Captcha for Forms?
How do I get a Captcha going on the forms, and\or only allow submissions by registered(logged in) users?
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
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.
Is this Captcha available in 4.1 sp1?
Thanks,
JH
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
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."
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
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.
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 >>
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
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 >>
Thanks Ivan
I Managed to fix it by commenting following line of code.
base
.ConfigureSubmitButton(control, validationGroup);
@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
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
Thanks Antoaneta
Sad to hear we are not getting a captcha functionality anytime soon.
Have a nice weekend.
Markus