[thelist] PHP - Selecting a variable recordset

Paul G Cavo pcavo at juno.com
Wed Oct 16 10:32:01 CDT 2002


I have a listbox which the users selects to determine which recordset
will (should) appear in a subsequent listbox, shown below.
The ChangeRst() function simply reposts the page with the
'SelectCriteria' as a variable. I'm open to suggestions on this as well.

function ChangeRst() {
        document.location =
"searchtype.php?SelectCriteria="+document.forms["SearchType"].SelectCrite
ria.value;
}

An additional problem is that my selection is no selected, but refeshes
to the default.

Upon the form re-posting on itself: the 'SelectCriteria' variable is
displaying correctly in the URL querystring, but the recordset selected
is not populating the listbox. I'm assuming that the error in my coding
is in the 'echo $_GET['SelectCriteria']' section of the 'SelectResults'
listbox. Is it returning the variable as a recordset or as a string? I'm
stumped. The output source indicates the following : "Fatal error:Call to
a member function on a non-object", hence my assumption that it is not
recognizing a recordset.

within a form:
<tr><td width="28%"> Search Type:</td>
      <td width="36%"> <select name="SelectCriteria" id="SelectCriteria"
onchange="javascript:ChangeRst();">
     <option value="">--Select One--</option>
           <option value="rst1">1</option>
           <option value="rst2">2</option>
           <option value="rst3">3</option>
        </select>
  </td></tr>
    <tr>
      <td>Search results:</td>
      <td colspan="2"><select name="SelectResults" id="SelectResults"
size="10">
          <?php
   while(!$_GET['SelectCriteria'] ->EOF){
?>
          <option value="<?php echo
$_GET['SelectCriteria']->Fields[0]?>">
          <?php echo $_GET['SelectCriteria']->Fields[1]?></option>
          <?php
    $_GET['SelectCriteria']->MoveNext();
  }
  $_GET['SelectCriteria']->MoveFirst();
?>
        </select></td>
    </tr>

Any ideas are greatly appreciated. I'm not commited to this design.
Thanks.

________________________________________________________________
GET INTERNET ACCESS FROM JUNO!
Juno offers FREE or PREMIUM Internet access for less!
Join Juno today!  For your FREE software, visit:
http://dl.www.juno.com/get/web/.



More information about the thelist mailing list