Compare Validator with Checkboxes

Does the CCompareValidator work with checkBoxList? Basically I have a dropDownList "native_language" and a checkBoxList "additional_languages". I want to ensure that a user cannot select a language in the checkBoxList if they have selected that language in the dropDownList.

Both these controls use the same data source, so their values are the same. I can’t get it to work - I have tried the following rule:

array('additional_languages', 'compare', 'compareAttribute'=>'native_language', 'operator'=>'!='),

I even tried the reverse operation (i.e. it should pass validation if both the values are equal) but that did not work either. I only selected one checkbox and I did a echo of the POST values and they were both the same.

I sorted this by creating a custom validation function:

public function languagesCheck($attribute, $params)


	if(!empty($this->$attribute) && in_array($this->native_language, $this->$attribute))


		$this->addError($attribute, "You cannot select your Native Language as an Additional Language.");



I think it didn’t work using the built-in validator because the checkBoxList is an array. Is it worth filing a request for the Compare Validator to support arrays, i.e. check if a value exists in the array (similar to range validator but other way round)?