Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to pull variable from one form to another form on same web page
    text
    copied!<p>I have a php web page that has 2 separate forms on it that both show results at the bottom of the page. The first form uses one drop-down menu (titled Quickshow) with 6 choices that filters the results when selected, with the top choice being the default selection when the page is opened. The second form has 6 drop-down menus, each with multiple choices, that filters the results once the "Filter Results" button is clicked. </p> <p>My problem is when the second form is used, it is using the default selection from the first form instead of staying with the selected choice from the first form. I understand the code that is making the first choice the default, and also allowing it to change for the first form, but how do I keep (call?) the optional choices for the second form? Below is the code being used for both forms. The first part is the web (.php) page portion, the second part is on the template (.tpl) page that is being pulled over to the web page. I didn't write the pages, but am trying to fix the filter on it.</p> <p><strong>.php page</strong> function enumRequests() {</p> <pre><code>$getQuickShow = 1; if (!$_REQUEST['feature_quickshow'] == '') { $getQuickShow = (int)$_REQUEST['feature_quickshow']; } $quickShow = eval(quickShow($getQuickShow)); $whereArray[] = (string)$quickShow; if ($_REQUEST['resultsFiltered']) { $quickShow = eval(quickShow($getQuickShow)); //$whereArray[] = (string)$quickShow; foreach ($_REQUEST AS $key =&gt; $val) { if ($val) { $val = mysql_real_escape_string($val); if (strpos($key, 'fld_') === 0) { $newKey = str_replace('fld_','',$key); $whereFragment = "{$newKey} = '{$val}'"; $whereArray[] = (string)$whereFragment; } } } } </code></pre> <p>}</p> <p><strong>.tpl page</strong></p> Quick Show:<br>[@quickshow] <p> </p> <p>Thanks in advance for any help I receive with this.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload