Monday, May 18, 2015

Extra html tags breaking the page in WFFM 2.3

We all pay attention to a little red asterisk that means "field is required". But once in a while when the form is large or you are not paying attention it takes a couple of attempts to fill everything out correctly. And that's when the page breaks if you are filling out a checkbox list field on a WFFM form.

Suppose I have a form similar to this:


If I pick at least one option under Sample Options checkboxlist and leave of the required fields blank (i.e.City) and click Submit I would get a typical "required field" error. But if I click Submit again and leave any required field blank one more time I get the following exception:


This happens due to the code in Sitecore.Form.Web.UI.Controls.ListControl class inside assembly Sitecore.Forms.Custom, Version=2.3.0.0.


I made a custom class that overwrites the ListControl and doesn't have those tags in it. And the CheckboxList, also a custom one, inherits from it. This bug is fixed in the next version of WFFM (2.4).

No comments:

Post a Comment