• Resolved Graicifyd

    (@graicifyd)


    Hello,

    Please is it possible to set the options of a dropdown field to be the texts entered in 3 different single text fields.

    For example,

    fieldname1 = single text field

    fieldname2 = single text field

    fieldname3 = single text field

    I want fieldname4 to have 3 options.

    option1 = text entered in fieldname1

    option2 = text entered in fieldname2

    option3 = text entered in fieldname3

    Would this be possible?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @graicifyd

    Yes, that’s possible by using the setChoices method of the DropDown field object.

    For example, assuming the dropdown is the fieldname123 field, you can insert an auxiliary calculated field in the form and enter the equation:

    getField(fieldname123|n).setChoices({'texts':[fieldname1|r, fieldname2|r, fieldname3|r],'values':[fieldname1, fieldname2, fieldname3],});

    Best regards.

    Thread Starter Graicifyd

    (@graicifyd)

    Alright.

    Thank you so much.

    Thread Starter Graicifyd

    (@graicifyd)

    So am I to leave the options in the dropdown blank? Since they will be filled automatically?

    Plugin Author codepeople

    (@codepeople)

    Hello @graicifyd

    You can leave them empty or not. The code will replace the existing choices with new ones.

    Best regards.

    Thread Starter Graicifyd

    (@graicifyd)

    The page is going into error after implementing the code.

    Plugin Author codepeople

    (@codepeople)

    Hello @graicifyd

    Please, indicate the URL to the page to check your code in action.

    Best regards.

    Thread Starter Graicifyd

    (@graicifyd)

    Nevermind, I figured it out.

    Thank you so much.

    • This reply was modified 2 years, 2 months ago by Graicifyd.
Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘set dropdown options from another field’ is closed to new replies.