Bharat_Naik
Senior Member Members
    Offline
 Ever ready to learn and share
Posts: 1202
Location: Chicago, Illinois
Joined: Dec 16 th, 2003
|
Re: selecting multiple choices from a list
Reply #2 - Feb 12th, 2004 at 1:17pm
|
Print Post
|
Yes, you can have multiple entries in Keyword field (without adding any additional LE) from a list using Userselect command. It involves a little code. Let's say the Keyword Element is Hobbies
Hobbies: Following Code goes in Hobbies LE
============= On Element Entry Event
var vHobby as String = @UserSelect("Tennis,Golf,Polo")
if Hobbies = "" then Hobbies = vHobby
Else if Hobbies <> "" and @in (Hobbies, vHobby) > 0 then { Hobbies = @Replfir (Hobbies, vHobby + ";", "") Hobbies = Hobbies + ";" + vHobby }
============= On Element Immediate Change Event
Hobbies = Hobbies + @Userselect ("Tennis,Golf,Polo")
============== On Element Exit Event
var vLine as string
VLine = Hobbies If @Right (vLine, 1) = ";" then vLine = @Del (Vline, @len (vLine), 1)
VLine = @replace (vLine, ";", "; ") vLine = @Replace (vLine, " ;", ";")
While @in (vLine, " ") > 0 { vLine = @replace (vLine, " ", " ") }
Hobbies = vLine
After selecting first choice from the list, Key in ";", that will popup list again for next choice. Do not worry about formatting at this point. Element Exit event code will take care of that.
Element Immediate Change event code makes editing very difficult if not impossible. Everytime you try to change something, the list of choice will pop-up and make editing challenging. Remember, <esc> key will temporarily get the list off and use mouse selecting the text to be deleted rather than try to delete it with the keyboard.
I hope this will help.
|