Community > Answers
104 views

Setting selected item in certain types of dropdowns

I'm using LiveForms to  build out a profile update form that contains dropdown controls that I'm trying to set the "selected item" to match the user's profile value.

The profile form contains a standard Country dropdown selector. Can it be set to default to someone's Profile:Country? Another control on the form is a dropdown selector built from an SQL query. Can it be set to default to someone's Profile:storedValue? Getting the value isn't the problem - setting the selected item is.

I have hidden fields on the form that captures both values, and a jquery script that refers to them. Yet various jQuery scripts I have experimented with fail to ultimately set the selected items themselves.

eswanzey eswanzey
asked 03/06/2019 17:55
Add Comment
Last Activity 03/06/2019 23:29

1 Answer(s)

  • answered 03/06/2019 20:34
    Mandeep Singh
    Add Comment
    eswanzey
    replied 03/06/2019 20:53

    What happens is Live Forms replaces the first item in the dropdown list with the literal text string e.g., "[Profile:myToken]"

    Should I report as a bug?

    Mandeep Singh
    replied 03/06/2019 21:00

    That's correct. Dropdown "Default Value" is the placeholder such as "Please Select"

    What we're looking for is the Selected Value; dropdown only allows you to select from an existing list. This would need to go in our Ideas; so you can bind a Profile Value if the dropdown is dynamically generated. 

    eswanzey
    replied 03/06/2019 22:30

    I can put that into Ideas. But to be clear, I think there's also a bug at play. Even when the dropdown field is standard, the Profile Token fails to translate and the default value presented is the literal token string.

    Mandeep Singh
    replied 03/06/2019 23:29

    That is the expected behavior. The default value for Dropdown is a literal such as "Please Select" or "Choose One". It's not the selected value. 


    Reply
Add an Answer