• Resolved michaelrieder

    (@michaelrieder)


    Hi CodePeople

    I’m currently looking for a solution to assign two values in a dropdown field.

    Because I can assign only one value to a dropdown text (row) I thought I assign a value like 1123-14,5 and with a caculation field I extract the first part (1123) and with another calculation field I extract the second part (14,5). Any idea how to manage that. e.g. with string operations like right, left, find, lenght …

    Best Regards Michael

    The page I need help with: [log in to see the link]

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

    (@codepeople)

    Hello @michaelrieder

    I’ll try to describe the process with a hypothetical example.

    Assuming the dropdown field is the fieldname123, you can insert a calculated field in the form and enter the equation:

    fieldname123|r.split('-')[0]

    And the second equation:

    fieldname123|r.split('-')[1]

    Please note 14,5 is no valid Javascript number. In Javascript, the decimal separator is the point. If you want to use the values for mathematical operations, I recommend you to enter 1123-14.5

    Best regards.

    • This reply was modified 11 months, 2 weeks ago by codepeople.
    Thread Starter michaelrieder

    (@michaelrieder)

    You make my day!

    Thread Starter michaelrieder

    (@michaelrieder)

    Hi CodePeople

    one more little issue: I make my selection and both splits work. Then I overwrite the calculated fields manually. When I do another selection, the manually edited values remain regardless of my selection of the dropdown field.

    Best Regards Michael

    Plugin Author codepeople

    (@codepeople)

    Hello @michaelrieder

    The calculated fields have the “If value entered manually, no evaluate equation” checkbox. If you tick it, the field does not evaluate the equation when the user enters the value manually. If you untick the checkbox, the plugin evaluates the equation even if the user enters the field’s value manually.

    Best regards.

    Thread Starter michaelrieder

    (@michaelrieder)

    Hi CodePeople

    I made a test form under https://teamtacho.de/000-test/

    As long as I do not change any value everything works fine. Changing a value and then select another dropdown entry the changed value stays.

    After a second selection it works right. But if I change both values the first never resets anmore.

    Best Regards Michael

    Plugin Author codepeople

    (@codepeople)

    Hello @michaelrieder

    My apologies for the delay in responding to your question. Could you please install the latest plugin update, released just now, and purge your website and browser caches?

    Please let me know if the issue persists.

    Best regards.

    Thread Starter michaelrieder

    (@michaelrieder)

    Hi CodePeople

    with the new version of the plugin it works perfectly.

    Thanks!

    Plugin Author codepeople

    (@codepeople)

    Hello @michaelrieder

    Thank you very much for the feedback.

    Best regards.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘string operations’ is closed to new replies.