This topic is locked

AJAX DROPDOWN BOX

12/7/2007 11:22:21 AM
PHPRunner General questions
G
garethp authorDevClub member

Hello
I have created an ajax dropdown/lookup box for a field in an "add page" screen. However the ajax returned results only use the start of the field that is being searched.
I know that if you want all value contained in the search to be shown you can change the $suggestallcontentvariable to true, however this seems to only apply to the main advanced search and search functions and is working brilliantly.
However, is there any way to get my "add page" dropdown/lookup to behave in this way too - so it look for the value contained not just at the beginning?
Many thanks for all your help - I am so impresses with phprunner.

Alexey admin 12/10/2007

Hi,
you can modify ..._lookupsuggest.php file for this.
Change the SQL string there to use

LIKE '%search%'

instead of

LIKE 'search%'

G
garethp authorDevClub member 12/10/2007

fantastic fantastic - this is brilliant!!! Thanks so much
Users may find this useful where to put the '% - I had to try a couple of possibilities as I am not a programmer.
$LookupSQL .= "`part` LIKE '%".db_addslashes($value)."%'";