Bug reports Found a bug? Post it here please.
Version 5.x > Bug reports > Captcha fails first time View modes: 
User avatar
Member
Member
brien-anca - 3/21/2011 5:58:09 PM
   
Captcha fails first time
My bizform has a captcha (security code field) which is considered invalid on the first post even when you enter the correct value. It validates correctly on the subsequent posts. I have tested on several computers and browsers (with cleared caches)

User avatar
Kentico Support
Kentico Support
kentico_zdenekc - 4/5/2011 12:06:49 PM
   
RE:Captcha fails first time
Hi,

Few questions first:

- Which version exactly are you using?
- Are you using ASPX templates or Portal engine dev. approach?
- Have you modified the BizForm webpart in any way (or the captcha control)?
- Are you using custom Form layout or custom form controls for your BizForm fields?
- Is your BizForm wrapped in the UpdatePanel or in any fancy <some>Box javascript-driven code?
- Is it possible to see the behavior online somewhere?

Any further details could be helpful.

Regards,
Zdenek

User avatar
Member
Member
brien-anca - 4/5/2011 4:46:14 PM
   
RE:Captcha fails first time
Version: When I login to CMS, I see v5.5.3950. Is that the version #?
Portal model
No Bizform mods
No custom form or layout
Bizform is dropped into an editable region on a regular page. no JS.
You can see the behaviour on
http://www.anca.com SLASH News SLASH Newsletter-Signup.aspx
(Use kentico in your details so I know it's a test).

User avatar
Kentico Support
Kentico Support
kentico_zdenekc - 4/12/2011 2:09:18 AM
   
RE:Captcha fails first time
Hi,

Thank you for the info.

Version - yes, that's <major>.<minor> version number, followed by 4-digid build number (reflects the bin DLLs version).

I think the country selector in your BizForm might be cause of this issue. That's because it causes partial postback, when some country (state) is selected. Captcha code refreshes itself after this action (and by default generates new number), however it's not rendered again.

Could you please try to set private bool mGenerateNumberEveryTime = true to false in ~\CMSFormControls\SecurityCode.ascx.cs file?

Alternatively, you could add a test for asynchronous postback to the following condition instead:

// Regenerate security code if it is not valid after postback
if (RequestHelper.IsPostBack() && !IsValid() && GenerateNumberEveryTime && !RequestHelper.IsAsyncPostback())

Hope it will help.

Regards,
Zdenek

User avatar
Member
Member
brien-anca - 4/12/2011 8:01:52 PM
   
RE:Captcha fails first time
kentico_zdenekc wrote:
Could you please try to set private bool mGenerateNumberEveryTime = true to false in ~\CMSFormControls\SecurityCode.ascx.cs file?


This seemed to fix it. Thanks