[TYPO3-dev] search form looses id

Richard Davies richard at ocular.co.nz
Mon May 28 00:16:09 CEST 2012


Hi,

The link in <form action="' . $searchResultPageLink . '" method="GET"> is
being generated correctly? Is the correct URL sent? If you use firefox, use
something like Tamper Data to view what is being sent to the server.

The issue may be that you accidentally nested your form inside another
form. This is obviously not allowed - however FF sends the outer form
action, hence why you wouldn't see the id value being carried across.

Richard

On 27 May 2012 07:11, Robert Wildling <robertwildling at gmail.com> wrote:

> Hi,
>
> I really beg for your help!!!
>
> An ext generates a form like this.
>
> ...
>        function main($content, $conf) {
>                $this->conf = $conf;
>                $this->pi_setPiVarDefaults();
>                $this->pi_loadLL();
>
>                // Database tables
>                $categoryTable = 'pages';
>                $categoryPid = 3;
>                $provincesTable = "static_country_zones";
>                $provincesArea = 'zn_country_iso_2="AT"';
>
>                $manufacturerPid = 10;
>                $searchResultPagePid = 89;
>
>                // Link generation for the action attribute of the form tag
>                $searchResultPageLink = $this->pi_getPageLink($**
> searchResultPagePid);
>
>                // Generate the search form - 1.: Categories
>                $content .= '<form action="' . $searchResultPageLink . '"
> method="GET">';
>                $content .= '<select name="category" id="selectCat">';
>
>                // Get first level of the categories
>                $selectManufacturers = $GLOBALS['TYPO3_DB']->exec_**
> SELECTquery('*',$**categoryTable,'pid='.$**categoryPid,'','','');
>                $numManufacturers = $GLOBALS['TYPO3_DB']->sql_num_**
> rows($selectManufacturers);
>
>                $i = 0;
>                while ($res = $GLOBALS['TYPO3_DB']->sql_**fetch_assoc($**
> selectManufacturers))
>                {
>                        $content .= '<option value="' . $res['uid'] .'"';
>
>                        // if category is set, set the chosen record to
> selected
>                        if((t3lib_div::_GET('category'**) != '') &&
> (t3lib_div::_GET('category') != 'divider') && (t3lib_div::_GET('category')
> == $res['uid'])) {
>                                $content .= " selected='selected'";
>                        }
>                        $content .= '>' . $res['title'] . '</option>';
>
>                        // Get second level of the categories
>                        $sel = $GLOBALS['TYPO3_DB']->exec_**
> SELECTquery('*',$**categoryTable,'pid='.$res['**uid'],'','','');
>                        while ($res2 = $GLOBALS['TYPO3_DB']->sql_**fetch_assoc($sel))
> {
>                                $content .= '<option value="' .
> $res2['uid'] . '"';
>
>                                if((t3lib_div::_GET('category'**) != '')
> && (t3lib_div::_GET('category') != 'divider') &&
> (t3lib_div::_GET('category') == $res2['uid'])) {
>                                        $content .= " selected='selected'";
>                                }
>                                $content .= '>- ' . $res2['title'] .
> '</option>';
>                        }
>
>                        $i++;
>                }
>                $content .= '</select>';
>
> ... (2nd select box)
>
>                // Search Button
>                $content .= '<input type="submit" value="' .
> $this->pi_getLL('submit_**button_label') . '" />';
>
>                // close form tag
>                $content .= "</form>";
>                $content .= '</div>';
>
>                return $content;
>        }
>
>
> After clicking on the search button, the id, which is saved in
> $searchResultPagePid and correctly generated as a link in
> $searchResultPageLink, gets "lost", while the parameters (category=xy) are
> part of the URL.
>
> What am I doing wrong here?
> config {
>  linkVars = L, print
>  uniqueLinkVars = 1
> }
>
> is set ...
>
> Any ideas? Please!
>
> Thank you very much!
> Robert
> ______________________________**_________________
> TYPO3-dev mailing list
> TYPO3-dev at lists.typo3.org
> http://lists.typo3.org/cgi-**bin/mailman/listinfo/typo3-dev<http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-dev>
>



More information about the TYPO3-dev mailing list