Choices with unique entry option

Forgive me if this has already been addressed but I couldn’t find where it has been.

In Pan 6, you could make a “choices” field that had canned choices and an option to enter a unique value. Am I wrong or does Pan X not have the option? Is the work around to just make the field clairvoyant?

You are not wrong, and yes, I think usually Clairvoyance is the best option for this.

I did some experimenting with adding an Other… item to the end of the items in the Choices pane in the Field Properties panel. I then added a “call .other” to the Code pane and created a procedure named .other with this code:

If «» = "Other…"
let otherValue=""
supergettext otherValue,{height=100 width=288 buttons="Add;Cancel"}
    if info("dialogtrigger") match "Add"
        «»=otherValue
    elseif info("dialogtrigger") match "Cancel"
        «»=""
    endif
endif

Now if one checks Other… in the popup list of choices a text entry box will open for them to enter the unique value desired and that will be entered into the field if the Add button is pressed. If the Cancel button is pressed the field will revert to “”. Didn’t spend a whole lot of time experimenting with this but it does seem to function properly. Like always, buyer beware.

1 Like

Very nice workaround. Works like a charm.

Gary’s solution could be enhanced with the click: and modify: labels to remember the initial value of the cell, and use that for the initial other value (instead of blank).

Also, you could use a pop-up menu with an “other” choice instead of the choice radio buttons. For more information on both of these topics see:

Look under Running Code when a Field is Clicked.

Gary,

I use your in forum workaround for this from March '17 regularly.

Good grief, did I reinvent my own wheel?