Ok, Here is the code for what I am doing, and the ajax library being
used is SACK from
http://twilightuniverse.com/projects/sack/ I just
can't seem to pass more than about 6100 characters... Any ideas, or a
better way to go?
<?php
//If some search criteria was sent
if(isset($_GET['searchCriteria ']))
{
//////////////////////////////// DB
Connection ///////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////
include('./adodb/adodb.inc.php') ;
//Type of connection
$db = NewADOConnectio n('oci8');
//Sets the query results to come back as assoc arrays
$db->SetFetchMode(A DODB_FETCH_ASSO C);
//Make the connection
$db->PConnect('xxxx x', 'yyyyy', 'zzzzz');
//////////////////////////////////////////////////////////////////////////////////////////////////////
$rs = $db->Execute("SELEC T DISTINCT ID, NAME FROM PEOPLE WHERE
UPPER(NAME_DISP LAY) LIKE '".$_GET['searchCriteria ']."%'");
$results = null;
while ($arr = $rs->FetchRow()) {
echo "obj.option s[obj.options.len gth] = new
Option('".rawur lencode($arr["NAME"])."','".rawurle ncode($arr["ID"])."');
\n";
}
exit;
}
?>
<link href="style.css " rel="stylesheet " type="text/css" />
<!-- AJAX for processing customer name search -->
<script type="text/javascript" src="ajax.js"></script>
<script type="text/javascript">
var ajax = new sack();
function searchInput(inp ut)
{
//Set a variable to hold the value from the form input field
var searchCriteria = input.value;
//Empty results select box
document.getEle mentById('resul t').options.len gth = 0;
//If there is search criteria, then process
if(searchCriter ia.length>0)
{
//Pass to php to process
ajax.requestFil e = 'tst2.php?searc hCriteria='+sea rchCriteria;
//Specify function that will be executed to display results
ajax.onCompleti on = createResults;
//Execute AJAX function
ajax.runAJAX();
}
}
function createResults()
{
var obj = document.getEle mentById('resul t');
//Executing the response from Ajax as Javascript code
//Sent from php as an escaped string so must escape
alert(unescape( ajax.response)) ;
eval(unescape(a jax.response));
}
</script>
<!-- END AJAX for processing customer name search -->
<table>
<tr>
<td><b>Custom er Name:</b></td>
<td>
<input class="cust" id="search" name="search" type="text"
onchange="searc hInput(this)">
</td>
</tr>
<tr>
<td> </td>
<td><select multiple size="10" id="result" name="result">
</select>
</td>
</tr>
</table>