[TYPO3-project-formidable] Reset/clear pager page number when doing new search

Gary Wong gary.wong at spingroup.com
Wed Jul 15 01:57:52 CEST 2009


I have a SEARCHFORM and a LISTER that uses it, and a PAGER to page 
through the results.

Let's say you are on page 3 of the results, and then perform a new 
search... it will bring you a new set of search results but you will 
also be on page 3 of that new set.  Worse yet, if your new set of search 
results doesn't have a page 3, you'll be in no-man's land.

What I need is if the search form is submitted, then the page number is 
reset.  The way I did this is by changing the FORM ACTION, since that's 
where the page number is set when submitting the search form (as part of 
the GET query).

This doesn't seem like a very good solution but it works.  So if anyone 
knows of a better way to do this, let me know.

My solution:

        <form formid="myform">
          <action>
              <userobj>
                <php><![CDATA[
                    return "index.php?id=" . $GLOBALS['TSFE']->id;
                ]]></php>
            </userobj>
          </action>
        </form>


Thanks,
Gary Wong




More information about the TYPO3-project-formidable mailing list