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,

Marian

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" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>

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

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

</head>

<body>

<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>

		<br/>

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

		<br/>

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

		<br/>

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

	</span>

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

</div>

</body>

</html>



Tested with the direct input validator - http://validator.w3.org/#validate_by_input. 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 :)