Is it possible to change the type of field using javascript?

Hi all,

I have a reusable search field which allows users to enter free text.

In some circumstances it would make sense to turn the field into a combobox. Is there any way of doing this? Or, do I need to have two fields on the form, hiding and showing them as need be?

swingman:
Hi all,

I have a reusable search field which allows users to enter free text.

In some circumstances it would make sense to turn the field into a combobox. Is there any way of doing this? Or, do I need to have two fields on the form, hiding and showing them as need be?

I’m afraid that the two-field option is the only one…:slight_smile:

As an alternative, you can consider to format the field as Type-ahead, filling or emptying the valuelist according to your needs.

I will often make another field (with combobox) - and using the onShow event of the form - set the visible property of the second field (with combobox) to false.

Then, when I want it to show - I will just set the location X and location Y of the combobox field to the location x and location y of the type-in field. Works VERY well.

Hope this helps.