Page 1 of 1

Difference between selectedvalue and items in InputDropdown

Posted: Thu Dec 15, 2011 2:18 pm
by Ertenal
I have a product list page with filters for a couple of fields. One of the filters has values like '> 1', '< 1'. This will not work when you use the InputDropdown method. The select box shows up, but the option, when selected, will not have the selected="selected" attribute.

I was curious why so i tried to investigate it. The function InputDropdown goes to cms_module_CreateInputDropdown(). The html for the select box is build here. The selectedvalue field is filtered with the function cms_htmlentities(). So '>' turns into '>'. I can see why this is done. The problem however, this is not done for the value itself. So '>' stays '>'. So the equation $selectedvalue == $value will be '>' == '>' and this will never be true.

And to keep it more strange. There is a line before that says:

Code: Select all

//$value = cms_htmlentities($value);
Yes with comments. Why is this line not uncommented? Because when i do, it works..