Why does a range value evaluate to a blank string instead of a literal 0?
There seems to be a problem with having a zero(0) value in a select dropdown.
I am using select dropdown to do some minimum-maximum ranges on a field.
<select name="range-from:foo">
<option value="">Min Foo</option>
<option {if "0" IN ({low_search_range-from:foo})}selected="selected"{/if} value="0">0</option>
....
</select>
<select name="range-to:foo" id="property_number_of_bedrooms_to">
<option value="">Max Foo</option>
<option {if "0" IN ({low_search_range-to:foo})}selected="selected"{/if} value="0">0</option>
....
</select>
I tried choosing the option with value="0" and then submit. When I get back on the page, the option with the value="" is selected.
I tried outputting {low_search_range-from:foo} and {low_search_range-to:foo} and they both output a blank string.
It seems that low search probably type casted this to a string which returned a blank string.
How to solve this? I want to get 0 as my value literally when the option value is 0.
Replies
Low 10 Apr 2013 06:11
What version of Low Search are you running?
arvinsim 10 Apr 2013 06:21
I am using Low Search 2.1.2
Low 10 Apr 2013 06:47
I made changes regarding this in later versions, so try updating and see if it persists.
arvinsim 10 Apr 2013 09:40
Ok. I think this is working properly now in the new version. Consider this solved. Thanks!