TabIndex property

Apr 20, 2013 at 9:52 PM
Edited Apr 20, 2013 at 9:53 PM
The control doesn't implement the TabIndex property of the control, i.e. it doesn't set this option. E.g.
var RecaptchaOptions = {
tabindex : 2
};

For anyone who is interested, or if the author would like to add this. Here is what I did...
Recaptcha.cs - added this property
        /// <summary>
        /// Gets or sets the tab index of the recaptcha control.
        /// </summary>
        [Bindable(true)]
        [Category("Appearance")]
        [DefaultValue("0")]
        [Localizable(false)]
        public string TabIndex
        {
            get
            {
                object t = ViewState["RecaptchaTabIndex"];
                return ((t == null) ? "0" : (string)t);
            }

            set
            {
                ViewState["RecaptchaTabIndex"] = value;
            }
        }
altered this line
RecaptchaHtmlHelper htmlHelper = new RecaptchaHtmlHelper(this.PublicKey, this.Theme, this.Language, this.TabIndex);
RecaptchaHtmlHelper.cs - altered this line
       public RecaptchaHtmlHelper(string publicKey, RecaptchaTheme theme, string language,string tabindex)
added this property
        /// <summary>
        /// Gets or sets the TabIndex of the recaptcha box.
        /// </summary>
        public string TabIndex
        {
            get;
            set;
        }
altered this line;
sb.Append(String.Format("theme : '{0}',\nlang : '{1}',tabindex : '{2}'", Theme.ToString().ToLower(), language,TabIndex));
Works a treat.

PS
I don't use MVC, so I cheated in the RecaptchaMvcExtensions.cs
RecaptchaHtmlHelper rHtmlHelper = new RecaptchaHtmlHelper(publicKey, theme, language,"0");