0

My Low search form always searches for the first option in the field below (Grid column with value/label pairs) even if none of its options are selected. Can anyone help me with this?

http://mydomainname.com/index.php/properties?search:property_address_set:address_ward=Select+option

<select name="search:property_address_set:address_ward">
    <option>Select option</option>
    {exp:low_options:property_address_set}
    {if option:group != ''}<optgroup label="{option:group}">{/if}
    {options}<option value="{option:value}">{option:label}</option>{/options}
    {if option:group != ''}</optgroup>{/if}
    {/exp:low_options:property_address_set}
</select>

EE 3.5.2

1 Answer 1

2

You need to add value="" to the first option. This is how HTML and forms work.

  • This <option>Hello World</option> will submit Hello world
  • This <option value="hi">Hello World</option> will submit hi
  • This <option value="">Hello World</option> will submit an empty string
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.