checkboxlist wraps labels and inputs in a span

Hello guys,

I am using checkboxlist, but I don’t really like the fact that it wraps the labels, inputs and line breaks in a span. That is wrong.

Is there any way of removing that span ?

Kind Regards,


That was introduced to solve validation problems…

Why would you remove it… do you have any error/problem/issue with this?

As far as I know, this is invalid XHTML…

DId you test it ?

For example this is one simple code example stripped from a page generated with Yii

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">

<html xmlns="" xml:lang="en" lang="en">


	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

	<title>My Web Application - Create Company</title>



<div class="row">

	<label for="Company_ac1" class="required">Assigned categories 1 <span class="required">*</span></label>

	<input id="ytCompany_ac1" type="hidden" value="" name="Company[ac1]" />

	<span id="Company_ac1">

		<input id="Company_ac1_0" value="0" type="checkbox" name="Company[ac1][]" /><label for="Company_ac1_0">Prva kategorija X</label>


		<input id="Company_ac1_1" value="2" type="checkbox" name="Company[ac1][]" /><label for="Company_ac1_1">Druga kategorija</label>


		<input id="Company_ac1_2" value="3" type="checkbox" name="Company[ac1][]" /><label for="Company_ac1_2">Treca kategorija</label>


		<input id="Company_ac1_3" value="4" type="checkbox" name="Company[ac1][]" /><label for="Company_ac1_3">Cetvrta kategorija</label>


	<div class="errorMessage" id="Company_ac1_em_" style="display:none"></div>




Tested with the direct input validator - Gives no error.

Yes, I got the same result. It is strange. I am pretty sure a <br /> was not allowed in a span. Well… if it says it’s valid, then so be it :)