Audio does not work in Forms Captcha Widget
We've been using the baked in Captcha widget to protect our forms from SPAM. We recently received some angry feedback letting us know that our forms were not Visually Impaired friendly. The baked in Captcha is not accessible to those with vision problems. The standard Captcha (and RadCaptcha) have a download audio option that allows Visually Impaired people to download the audio and listent to what the letters/numbers are in the captcha so that they will be able to submit your forms. Unfortunately Sitefinity ended up pushing out the Captcha Widget without it being fully functional. They are aware of the problem but will not work on it unless enough people want it fixed. I think you would all agree that our forms need to be accessible. Please upvote the 'Bug Report' for this problem. Thanks!
http://feedback.telerik.com/Project/153/Feedback/Details/135331-audio-does-not-work-in-forms-captcha
Hello Richard,
We are really sorry for the inconvenience caused. Please, use the following extended captcha for the forms:
<%@ Control Language="C#" %>
<%@ Register Assembly="Telerik.Sitefinity" Namespace="Telerik.Sitefinity.Web.UI" TagPrefix="sf" %>
<%@ Register TagPrefix="telerik" Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" %>
<
div
>
<
telerik:RadCaptcha
EnableDownloadAudio
=
"true"
CaptchaAudioLinkButtonText
=
"Get Audio"
runat
=
"server"
ID
=
"radCaptcha"
EnableRefreshImage
=
"true"
CssClass
=
"sfFormCaptcha"
CaptchaTextBoxCssClass
=
"sfTxt"
CaptchaTextBoxLabelCssClass
=
"sfTxtLbl"
>
<
CaptchaImage
EnableCaptchaAudio
=
"true"
RenderImageOnly
=
"true"
ImageCssClass
=
"rcCaptchaImage"
BackgroundColor
=
"#609f0a"
TextColor
=
"White"
BackgroundNoise
=
"None"
></
CaptchaImage
>
</
telerik:RadCaptcha
>
</
div
>
<
div
>
<
asp:TextBox
ID
=
"rcTextBox1"
runat
=
"server"
MaxLength
=
"5"
Width
=
"170px"
></
asp:TextBox
>
</
div
>
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Web;
using
Telerik.Sitefinity.Modules.Forms.Web.UI.Fields;
namespace
SitefinityWebApp.MyControls
public
class
CustomRadCaptcha : FormCaptcha
public
override
string
LayoutTemplatePath
get
return
"~/MyControls/CustomRadCaptchaTemplate.ascx"
;
protected
override
string
ScriptDescriptorType
get
return
typeof
(FormCaptcha).FullName;
Thanks Nikola! So is the first bit an .ascx file? And do I need to use the 2nd snippit of code as the .cs file for the first bit? Does it matter where I put the file(s) in the folder structure? And then once I've added this code do I have to 'build' the solution? and then register it in the Toolbox? Is that correct?
Sorry I'm c#-impaired :)
Also will the original Captcha be fixed so we won't have to worry about updating the custom Captcha control with every version upgrade?
Thanks!
IMO the safer route is to just inherit from the default captcha control and enable it right there... then just replace the stock toolbox one with your quick 'tweaked' version.
Overriding an ascx embedded template is exposing yourself to a future failpoint. If the ever do anything to that widget template in an update you're hosed...
Hi all,
You can actually only modify the server side of the default captcha the following way:
using
Telerik.Sitefinity.Modules.Forms.Web.UI.Fields;
namespace
SitefinityWebApp.AudioFormsCaptcha
public
class
AudioFormsCaptcha : FormCaptcha
protected
override
void
InitializeControls(Telerik.Sitefinity.Web.UI.GenericContainer container)
base
.InitializeControls(container);
this
.Captcha.CaptchaImage.EnableCaptchaAudio =
true
;
this
.Captcha.CaptchaImage.EnableAudioNoise =
true
;
protected
override
string
ScriptDescriptorType
get
return
typeof
(FormCaptcha).FullName;
@Nikola
Yep that's exactly what I was talking about, thanks for the detailed post, I was no where near a computer to write\validate it.
(Although don't make a new toolbox widget, just set the type of the existing Captcha to SitefinityWebApp.AudioFormsCaptcha.AudioFormsCaptcha, SitefinityWebApp) In no case do you want your content editors to use the other one (as it doesn't work)
Hello,
You can just override the default captcha by specifying your custom one type, indeed, as Steve mentioned. This way the content editors will not notice any change in the UI, however, the custom captcha that provides the audio will be used.
Write back to us if any troubles are experienced.
Regards,
Nikola Zagorchev
Telerik