The function takes the string created and passed by searchServer.php,
decodes it, tests it for validity, and transforms it to an array
using this Javascript:
decodes it, tests it for validity, and transforms it to an array
using this Javascript:
<?php
function arrayFromString( s, delim )
{
var d = (delim == null) ? '|' : delim;
return s.split(d);
}
?>
Back to
into Option tags, inserted into a Select List, and the list placed
in the HTML document using innerHTML. (The
merely uses
handleResponse()
, the array of names is next transformedinto Option tags, inserted into a Select List, and the list placed
in the HTML document using innerHTML. (The
getOBJ()
functionmerely uses
getElementById()
to fetch the specified element.)
And that is it. The user now has a dynamic drop down list
wherein they can find and select the appropriate value for
futher processing. Amazingly, even though it is done on every
keystroke (after 2), it is surprisingly fast. Also,
with 60,000+ records, even a subset of records can be quite
large, but I’ve run into no problems with the string being
too large to pass through Javascript.
wherein they can find and select the appropriate value for
futher processing. Amazingly, even though it is done on every
keystroke (after 2), it is surprisingly fast. Also,
with 60,000+ records, even a subset of records can be quite
large, but I’ve run into no problems with the string being
too large to pass through Javascript.