Autocomplete in Csentry

Discussions about CSEntry
Forum rules
New release: CSPro 8.0
Post Reply
htuser
Posts: 631
Joined: December 19th, 2011, 6:26 pm
Location: Silver Spring Area, MD, USA

Autocomplete in Csentry

Post by htuser »

Dear Gregory,
Do you have some good method for implementing autocomplete task in csentry?
Thanks for response!
G.VOLNY, a CSProuser from Haiti, since 2004
Gregory Martin
Posts: 1777
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: Autocomplete in Csentry

Post by Gregory Martin »

Right now there is no convenient option for doing this. Perhaps you could use the selcase function to simulate the behavior of an autocomplete field, though that would force the user to type part of the response and press Enter without seeing if the response is valid.
PROC AUTOCOMPLETE_FIELD

    
if selcase(RESPONSES_DICT,strip(AUTOCOMPLETE_FIELD)) then
        AUTOCOMPLETE_FIELD = RESPONSES_FIELD;

    
else
        
// if the response has to be in the response listing, then uncomment the following line:
        // reenter;

    
endif;
htuser
Posts: 631
Joined: December 19th, 2011, 6:26 pm
Location: Silver Spring Area, MD, USA

Re: Autocomplete in Csentry

Post by htuser »

Dear Gregory,
Thanks for your help. However, when i try to implement the codes, the autocomplete task is not ok...
Please can you help me more?
Thanks in advance
Attachments
Autocomplete.zip
(5.25 KiB) Downloaded 383 times
G.VOLNY, a CSProuser from Haiti, since 2004
Gregory Martin
Posts: 1777
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: Autocomplete in Csentry

Post by Gregory Martin »

You may want to write code more like this:
if selcase(REPONSE_DICT,"") include(REPONSE) where pos(tolower(strip(FRUITS)),tolower(REPONSE)) then
Your external dictionary file could also just consist of the fruit names instead of also having a numeric ID (that you aren't using). In that case, the ID of your external dictionary would be the fruit name.

See attached for your program.
Attachments
Autocomplete.zip
(3.5 KiB) Downloaded 453 times
htuser
Posts: 631
Joined: December 19th, 2011, 6:26 pm
Location: Silver Spring Area, MD, USA

Re: Autocomplete in Csentry

Post by htuser »

Dear Gregory,
Thanks for all. That's work finely!
G.VOLNY, a CSProuser from Haiti, since 2004
Post Reply