# Type\_ahead fields:  forcing user choice from the list

**URL:** <https://forum.servoy.com/t/type-ahead-fields-forcing-user-choice-from-the-list/8055>\
**Category:** Classic Servoy\
**Created:** [August 24, 2007, 1:14am UTC](https://forum.servoy.com/t/type-ahead-fields-forcing-user-choice-from-the-list/8055 "2007-08-24T01:14:01Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_Mooney](https://avatars.discourse-cdn.com/v4/letter/m/45deac/32.png) [@Michael\_Mooney](https://forum.servoy.com/u/Michael_Mooney)\
**Post date:** [August 24, 2007, 1:14am UTC](https://forum.servoy.com/t/type-ahead-fields-forcing-user-choice-from-the-list/8055/1 "2007-08-24T01:14:01Z")

</div>

I have a standard type\_ahead field which gets its data from a fairly plain and standard valuelist (I have typed in several options within the valuelist Custom Values list).

My goal is to allow the user to select one of the available choices but not allow them to edit their selection.

So, I want to force them to choose one of the set of typed in options. I have tried different settings (e.g. - Editable property on and off, valuelist Allow Empty Value flag off) but can’t seem to get to a place where the user-chosen option can’t be edited. I can achieve my goal ok with a Combo Box: the user can not edit the choice they make with a Combo Box and Editable property = false.

Is this goal achievable with a Type\_Ahead field? If so, pls advise the method.

Thanks, Michael

---

<div class="post-metadata">

**Author:** ![IT2Be](https://avatars.discourse-cdn.com/v4/letter/i/dc4da7/32.png) [@IT2Be](https://forum.servoy.com/u/IT2Be)\
**Post date:** [August 24, 2007, 6:10am UTC](https://forum.servoy.com/t/type-ahead-fields-forcing-user-choice-from-the-list/8055/2 "2007-08-24T06:10:40Z")

</div>

I think not.  
Thinking ‘ahead’ I would say that a type ahead field should be editable and as a result not what you need.

---

<div class="post-metadata">

**Author:** ![Michael\_Mooney](https://avatars.discourse-cdn.com/v4/letter/m/45deac/32.png) [@Michael\_Mooney](https://forum.servoy.com/u/Michael_Mooney)\
**Post date:** [August 24, 2007, 4:13pm UTC](https://forum.servoy.com/t/type-ahead-fields-forcing-user-choice-from-the-list/8055/3 "2007-08-24T16:13:59Z")

</div>

Hi Marcel,

I am of a different opinion here. A type\_ahead field is an _excellent_ tool for performing a user-friendly search of available selections for a given column. It provides a very rapid and efficient filtering down of available rows to select from based upon the user’s initial typing. This applies in many areas I can think of (for e.g. - Contacts, Pick Lists for Countries, Inventory SKU’s, Part #'s, Labels, etc, etc). If I have say 300 rows in total to choose from I would much rather be in a type\_ahead than say a ComboBox.

I think what would be good, now that I understand it is not currently available, is something like:

1. The default setting for a type\_ahead field is as the current functionality stands;

2. Servoy add an (optional) element level property for type\_ahead fields requiring the user to choose from the available rows. If I used a type\_ahead field to get say a Country (out of 200 or so) then it would be handy to ensure they chose a valid one.

Not a big deal really - I can always fire a SQL select against the chosen item or test via other app-level functions for valuelists and still use the type\_ahead. I just think it would be a nice touch as an available design time element-level property. In my opinion anyway … ![:)]( "Smile")

Appreciate your feedback (it is good to know that what I desire is presently not available) - I will use other methods for now.

Worth a feature request? Other community feedback?

Michael

---

<div class="post-metadata">

**Author:** ![antonio](https://avatars.discourse-cdn.com/v4/letter/a/6de8d8/32.png) [@antonio](https://forum.servoy.com/u/antonio)\
**Post date:** [August 25, 2007, 11:20am UTC](https://forum.servoy.com/t/type-ahead-fields-forcing-user-choice-from-the-list/8055/4 "2007-08-25T11:20:59Z")

</div>

I’ll add my vote.  
I have used a Combo Box to achieve this effect but would prefer the reducing list that we get with a TypeAhead. Another difference - with the Combo Box, each key stroke triggers the OnDataChange form method, which interrupts the typeAhead effect.

---

<div class="post-metadata">

**Author:** ![jcompagner](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/jcompagner/32/4889_2.png) [@jcompagner](https://forum.servoy.com/u/jcompagner)\
**Post date:** [August 30, 2007, 9:56am UTC](https://forum.servoy.com/t/type-ahead-fields-forcing-user-choice-from-the-list/8055/5 "2007-08-30T09:56:13Z")

</div>

yes you must use a combobox or use a different type that is the real value  
So make a valuelist that stores an integer but displays a string. Then a user must make the right selection because something else can’t be mapped to a integer.

---

<div class="post-metadata">

**Author:** ![Michael\_Mooney](https://avatars.discourse-cdn.com/v4/letter/m/45deac/32.png) [@Michael\_Mooney](https://forum.servoy.com/u/Michael_Mooney)\
**Post date:** [August 30, 2007, 2:57pm UTC](https://forum.servoy.com/t/type-ahead-fields-forcing-user-choice-from-the-list/8055/6 "2007-08-30T14:57:00Z")

</div>

Johan,

Thanks, and appreciate your feedback. I am already using methodology as you suggest (string display, integer as the foreign key or referenced field).

My suggestion is to do with the user benefit (for ease of selection) the typeahead field provides. A combo box works ok but simply doesn’t provide the elegant filtering and ease of use the typeahead field does in certain data sets.

If you do come up with a solution where we can use the typeahead instead of the Combo Box in the stated scenario, please consider this as a feature request.

Best,

Michael

---

<div class="post-metadata">

**Author:** ![antonio](https://avatars.discourse-cdn.com/v4/letter/a/6de8d8/32.png) [@antonio](https://forum.servoy.com/u/antonio)\
**Post date:** [August 30, 2007, 9:57pm UTC](https://forum.servoy.com/t/type-ahead-fields-forcing-user-choice-from-the-list/8055/7 "2007-08-30T21:57:41Z")

</div>

And a related wish, could there be a way to disable the triggering of the OnDataChange event after each key-stroke in a Combo field, so it behaves like data entry in other fields.
