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
  • mihaela
  • Away
  • Administrator
  • Administrator
  • Posts: 2652
  • Karma: 92
  • Thank you received: 354

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: ForumSupporttomeperica
Time to create page: 0.053 seconds

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!

Live Support Chat Opened!

Join our Discord chat here to receive live support and talk directly to the team!

Summer Sale!

50% discount on all of our extension subscription plans, templates and icon packs!

Get Your Subscription Here

News and Updates

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

All Extensions Subscription

Get 1 year access to all of our current and future products and 1 year of professional support -- 99 for just 49! (Summer Sale)

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!

Live Support Chat Opened!

Join our Discord chat here to receive live support and talk directly to the team!

Community Reward

Help us to create new extensions and plugins! With only $5 you help us a lot and get unlimited download access to all of our products, professional support and even more. Get your reward now!

Read More Here