We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 49344
    • 6 Posts
    I have implemented AdvSearch functionality in my modx site. I got search result and all working good. I search value using dropdown select box.

    For my dropdown select box I have four options.
    <option value="all">All</option>
    <option value="1">Category1</option>
    <option value="2">Category2</option>
    <option value="3">Category3</option>

    When select any category except 'All' my search form show default option not the one I have selected before form submit.

    I want selected option in form as I have selected before form submit. Means if I have selected "Category1" my search form will show "Category1" as selected. Now it shows "All"
      • 4172
      • 5,888 Posts
      with the Extra getReqParam installed:

      <option value="2" [[!getReqParam:is=`2`:then=`selected="selected"`:else=``? &name=`the_name_of_your_select`]]>Category2</option>


      or if fastField or pdoTools is installed with a fastField - GET - tag
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 49344
        • 6 Posts
        Hi Bruno,
        Thanks for quick reply but getReqParam not working for me. Also my AdvSearch form display result after page refresh. In AdvSearch I have used queryHook to search custom tables. [ed. note: jaimin10 last edited this post 9 years, 5 months ago.]
          • 53699
          • 22 Posts
          Thanks allot for the great solution, I used it in custom form