We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8835
    • 21 Posts
    Is there a way to get ajaxSearch find a value from a range (of values)?
    means: treat/explode eg 1-5 as 1,2,3,4,5?

    for example:
    Call:
    [!AjaxSearch? &ajaxSearch=`1` &withTvs=`+:areaCode` &whereSearch=`content:NULL|tv` &minChars=`5`!]

    TV name:
    [*areaCode*]

    TV value(s):
    33000-33999,37600-37999


    What I would like to do is use ajaxSearch to search for eg "33001".

    So is there a way to teach AjaxSearch to treat "n1-n2" als a range of values? And eg search for "33001"?
    I do know how to explode the ranges in php but I can’t figure out how to achieve that without hacking ajaxSearch.

    I know there are all kinds of nifty filtering-, binding- and whatever options so I’m hoping I’m just missing the obvious.

    The idea is a search-by-areacode option where you enter an areacode/zip and get a matching contact.

    With one doc per contact in the backend and a tv containing that contact’s area-of-operation’s areacode ranges per contact.
    something like:
    [tt]|-Contacts
    |-- Huey ("33000-33999,37600-37999")
    |-- Dewey ("46200-46500,49000-49999")
    |-- Louie ("57000-57999,58100-58999")[/tt]

    or any other suggestions how to achieve that?
    Any hints appreciated smiley
      ▙▚▚▜ I don't think I can, you see, I'd have to want to ▙▚▚▜