Merge values and display results

  • MCPWA
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 1
  • Thank you received: 0

MCPWA created the topic: Merge values and display results

Hi,

from elements i want to calculate a merged variable to which i connect a value.
Let's say i have 3 elements, all picklists.
I want to merge the results from the 3 lists to 1 value.
So, on list 1 i selected A, on list 2 i selected Canada and on list 3 i selected Red.
The merged value should be ACanadaRed
The value ACanadaRed should represent a hardcoded value with the number "50".
Or
On list 1 i selected A, on list 2 i selected Germany and on list 3 i selected Yellow.
The merged value should be AGermanyYellow. This value should represent an hardcoded value with number "60"

I want to display this value on the bottom of the form as soon as the value is picked in one of the lists.

I already figured out the merged value (ACanadaRed) but now i want to add this number to it and display it.

How can i achieve this?
#237805
  • Posts: 3128
  • Karma: 105
  • Thank you received: 413

mihaela replied the topic: Merge values and display results

Hello,

Please send me the code that you have used to concatenate values from the 3 fields so I can tell you how to continue with the code.

Would you have predefined values for each combination? If that is the case you would have to add code similar to this:
var result = Number(0);
if( mergedvalue == "ACanadaRed") {
    result = 50;
}
else if(mergedvalue == "ACanadaBlue") {
    result = 60;
}
...

If points should be calculated for each field separately, for example, each country caries a certain amount of points, then the calculation should be done with if statements based on field by field. If that is the case, I will give you more instructions.

Regards,

Mihaela
#237849
Moderators: ForumSupport
Time to create page: 0.044 seconds

We Are Doing Our Part

Massive discounts on all of our extension subscription plans to help you and your business in these times.

Get Your Subscription Here

New Icon Packs Category!

Crosstec is now offering icon packs.

If you are a paying subscriber, icon packs are automatically added to your account.

Check out our icon packs page!

News and Updates

Get informed about new downloads, updates and more in our News and Updates newsletter.

All Extensions Subscription

We are doing our part and support your business with extremely low prices -- For example 6-Months-Subscription for only $9 USD. For as long as necessary.

No support per domain or website installation limits! Includes all of our current and future Joomla!® extensions, Joomla!® templates for the duration of your membership. This means, by purchasing an All Extensions Subscription you'll have it all covered!

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!