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

    (@codepeople)

    Hello @oidamo

    The code you are referring to is outdated. In the current version of the plugin, the process is simpler.

    If fieldname1 is a DropDown field, and you want to get its value, the code equation’s code in the calculated field would be: fieldname1

    If you want to assign this value to another field in the form, for example, the number field fieldname123, the equation’s code in the calculated field would be:

    getField(123).setVal(fieldname1);

    Best regards.

    Thread Starter oidamo

    (@oidamo)

    Thank you very much for your quick reply!

    I want to use the value not for a calculation but output the value as text in the label of another field (similar to the original post). Is this possible?

    Plugin Author codepeople

    (@codepeople)

    Hello @oidamo

    Yes, of course, the equation would be similar to:

    getField(123).jQueryRef().find('label').html(fieldname1);

    Best regards.

    Thread Starter oidamo

    (@oidamo)

    Sorry, I still don’t get it.

    I have a dropdown (fieldname1) with the options A and B which have the following text/value:

    text: “Option A includes …”, value: A
    text: “Option B includes …”, value: B

    In another field (fieldname2), which is, e.g. an instruction field, I want to output the value of the chosen option in the label of the field:

    “Thank you for choosing option A”.

    Where exactly do I have to put the equation you mentioned?

    Plugin Author codepeople

    (@codepeople)

    Hello @oidamo

    Please, follows the steps.

    1. Insert a calculated field in the form, and tick the checkbox in its settings to hide the field (this field will be used as auxiliary)

    2. Into the “Set Equation” attribute of the calculated field (a textarea in its settings) enter the following equation:

    getField(fieldname2|n).jQueryRef().find('label').html(fieldname1);

    And that’s all.
    Best regards.

    Thread Starter oidamo

    (@oidamo)

    Thank you very much for your explanation! Now the value of the chosen drowpdown option is displayed.

    Is there a possibility to include the value in a predefined sentence, for example “Thank you vey much for choosing option [value] which is a very good choice”?

    Plugin Author codepeople

    (@codepeople)

    Hello @oidamo

    Yes, of course.

    getField(fieldname2|n).jQueryRef().find('label').html('Thank you vey much for choosing option '+fieldname1+' which is a very good choice');

    Best regards.

    Thread Starter oidamo

    (@oidamo)

    Great plugin and great support, thank you very much!

    Can I also use the content of more than one field? I have 3 single line text fields (e.g., first name, last name, city) an want to use the text entered by the user in a sentence (e.g., “Welcome [first name] [last name] from [city] to my site.”)

    Plugin Author codepeople

    (@codepeople)

    Hello @oidamo

    It is exactly the same logic.

    getField(fieldname2|n).jQueryRef().find('label').html('Welcome '+fieldname3+' '+fieldname4+' from '+fieldname5+' to my site.');

    Best regards.

    Thread Starter oidamo

    (@oidamo)

    Perfect, thank you very much!

    Thread Starter oidamo

    (@oidamo)

    One more question: I want to have a button which copies the created sentence into the clipboard.

    I tried to use this code

    jQuery('[id*="fieldname2_"]')[0].select();document.execCommand('copy');

    but it does not work. What am I doing wrong?

    Plugin Author codepeople

    (@codepeople)

    Hello @oidamo

    Your question is not about our plugin. It is specific to your project. If you need additional help implementing your project, please, can contact me directly through my private website: Click Here

    Best regards.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Output of selected value of dropdown in another field’ is closed to new replies.