3 Replies Latest reply on Sep 16, 2013 9:43 AM by LyndsayHowarth

    Auto-Complete from any letter or word in a Value List

    amy

      Is it possible to have a drop down menu with auto-complete enabled and filter values from the list based on any letter or word in the list? For example if I have a vlaue list that contains these options;

       

      dandy fine daisy

      fun pink flower

      popular funny paper

      dimes purple dome

       

      And the user types the letter P have it the value list then display;

       

      fun pink flower

      popular funny paper

      dimes purple dome

       

      and if the user keeps typing the word PINK then only display

       

      fun pink flower

       

      Rather then only filtering from the first letter forward?

       

      Thanks,

      Amy

        • 1. Re: Auto-Complete from any letter or word in a Value List
          Mike_Mitchell

          Hello, Amy.

           

          There's not a direct way to have a value list populate options in the way you suggest. However, you can substitute a List View layout and a global field, together with an OnKeystroke triggered script to simulate the same functionality. Here's a basic plan:

           

          1) Create a global field and place it in the header of the List View layout.

          2) Set up a script that captures the value in that global field, performs a Find in the field on your List View, and then places the cursor back in the global field.

          3) Using the OnObjectKeystroke, fire the script whenever a user types a keystroke.

           

          This will accomplish basically what you want. Do be prepared for a bit of a performance lag in between keystrokes, though; it's often a good idea for the actual trigger to fire an OnTimer script that times out after a few seconds and performs the actual Find instead (thanks to Jeremy Bante for pointing out this UX technique).

           

          HTH

           

          Mike

          1 of 1 people found this helpful
          • 2. Re: Auto-Complete from any letter or word in a Value List
            amy

            Hi Mike,

             

            Thank you for the response.  I had thought of this method, although you had a few extra pointers, but since it is on a portal row (line items on an invoice) I think I'll table this for now.  Not sure if it will function quickly enough.

             

            Thanks,

            Amy

            • 3. Re: Auto-Complete from any letter or word in a Value List
              LyndsayHowarth

              Amy,

               

              Do this with a relationship rather than a find.

               

              Make Mikes global field match another field which is a calculation of the field with the actual values but separate the values by a return.... then use the build custom function from Brian Dunning's site in the calc to 'build" the values of each word.

               

              Your related records will show matches on all values which match each letter as it is typed.

               

              The trick is to have a script trigger that instead commits the record then reinserts the cursor in the field again (at the end) ready for the next character to be typed.

               

              I hope this makes sense...

               

              - Lyndsay