You are viewing limited content. For full access, please sign in.

Question

Question

The LFForm.changeFieldOptions Function with "selected: true" Setting Doesn't Appear to Work for Drop-Down Fields

asked on October 30, 2025

Tested on Version 12.0.2503.10378
This is the example given in the help documentation:

LFForm.changeFieldOptions( { fieldId: 10 }, [{label: "Choice 4", value: "Choice_4", selected: true}, {label: "Choice 5"}], "add" );

I've been playing around with this, and it doesn't look like including the "selected: true" element works with drop-down fields.  It adds the value(s) to the drop-down, but does not select the value no matter what I do with my testing.

Is this a bug?

0 0

Answer

SELECTED ANSWER
replied on November 3, 2025

This is likely a bug, and I'll look into it. In the meantime use setFieldValues to set the value making sure to await the changeFieldOptions call prior to setting the value.

2 0
replied on November 3, 2025

Thank you @████████

1 0
replied on January 15

This was driving me crazy, thanks for providing a work-around solution.

0 0

Replies

replied on January 15

I created an account and everything to just come ask this very question. I tried all sorts of things to get this to work and my suspicions were true. It just doesn't work. I will keep my eyes peeled for an update on this. Glad to know I am not the only one who saw the same thing.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.