0

I need to have a single option in a dropdown list that produces results from more than one value, like this:

<select name="length">
    <option value="">Any Length</option>
    <option value="3+4+5">3-5 Days</option>
    <option value="6+7+8+9">6-9 Days</option>
    <option value="10+11+12+13+14">10-14 Days</option>
</select>

For example, the first option works for 3, 4 and 5 days, but it also includes 13, 14 and 15.

I have tried numerous variations without success. Any suggestions?

  • Can you post some code? What exactly does the drop down do, set a value? Which one, where? I'm a little confused on the details. – Ingmar Jan 5 '16 at 16:23
  • Sorry for the sloppy display above. I have a directory with a series of entries that each have a certain length of time, i.e., 7 for 7 days. The option value is meant to combine groups of days in the search results such as all entries that have a length of 3,4 or 5 days. – Scott S. Bateman Jan 5 '16 at 16:29
0

I'm not sure you can accomplish what you're looking to with a select field and SuperSearch. One solution would be to use two fields and the from and to modifiers:

https://solspace.com/expressionengine/super-search/docs/form/#customfield-from

https://solspace.com/expressionengine/super-search/docs/form/#customfield-to

If you really want to run with a select, you can work some front-end magic with jQuery. Stop the propagation of the form submittal, and get the value of the length select. Then set two hidden input fields with the customefield-from and customefield-to value you'd like (3-5, 6-9, etc..), and continue with the form submit.

It might still be possible; the documentation is your friend, dig in, I may have missed something.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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