Berechnung/calculating von select-list

  • d4s_m4v3r
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 2
  • Thank you received: 0

d4s_m4v3r created the topic: Berechnung/calculating von select-list

Hallo,

wir benutzen folgendes Skript für die Berechnung von Feldern: crosstec.org/en/support/online-documenta...ting-textfields.html

ist es möglich innerhalb des Skripts eine If Schleife zu verwenden?

Beispiel: Wir möchten folgendes berechnen.

Select Liste 1: 1 Jahr 5%, 2 Jahre 10%
Textbox 1: Eingabe von Zahl

Je nachdem welche Auswahl getroffen wurde soll Textbox 1 zuerst die Prozentzahl abziehen und danach durch die entsprechende Monats Zahl teilen.

Vielen Dank
_____________________________________________________________

Hello,

we are using the following script to calculate: crosstec.org/en/support/online-documenta...ting-textfields.html

is it possible to place an if statement?

For example:

Select list 1: 1 year 5%, 2 years 10%
Textbox 1: input of number

Depending on which selection was made to text box 1 first deduct the percentage and then divide by the corresponding month number.

Best regards
#181088
  • Posts: 2667
  • Karma: 76
  • Thank you received: 329

lovre replied the topic: Berechnung/calculating von select-list

Hi,

can you please send us your form so we can work on it, it's easier that way. Follow these steps to create a Form Pacakge:
crosstec.org/en/support/online-documenta...ted/94-packages.html

Zip it (.zip) and attach here.

Support Crosstec and get ALL EXTENSIONS and professional support for just $5
Here!
===========================================
Need to renew Pro Support?
Buy Here!
===========================================
Satisfied?
Consider a membership!
===========================================
Like us on Facebook
===========================================
#181093
  • d4s_m4v3r
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 2
  • Thank you received: 0

d4s_m4v3r replied the topic: Berechnung/calculating von select-list

Thanks for your support!
#181097
Attachments:
  • Posts: 2667
  • Karma: 76
  • Thank you received: 329

lovre replied the topic: Berechnung/calculating von select-list

Hi,

I'm sending you your form back in a package. We have removed the actionscript from the "total" field and made an initialization script (Form> Advanced> More Options> Scripts> Initialization Scriopt> Custom) like this:
function ff_miete_init()
{
setInterval(function() {
var months = ''
if (jQuery('[name="ff_nm_rabatt[]"]:checked').val() == '5')
{months='12'}
else if (jQuery('[name="ff_nm_rabatt[]"]:checked').val() == '10')
{months='24'}
else if (jQuery('[name="ff_nm_rabatt[]"]:checked').val() == '20')
{months='36'}
else if (jQuery('[name="ff_nm_rabatt[]"]:checked').val() == '30')
{months='48'}

ff_getElementByName('total').value =
(Number(jQuery('[name="ff_nm_wartungsvertrag[]"]:checked').val()) - 
(Number(jQuery('[name="ff_nm_wartungsvertrag[]"]:checked').val()) * 
Number(jQuery('[name="ff_nm_rabatt[]"]:checked').val()/100))) / 
Number(months);
}, 500);
} // ff_miete_init

Please test the form and let us know if the calculation is done right. If not please provide us with a simple math formula on how to calculate the total field.

Support Crosstec and get ALL EXTENSIONS and professional support for just $5
Here!
===========================================
Need to renew Pro Support?
Buy Here!
===========================================
Satisfied?
Consider a membership!
===========================================
Like us on Facebook
===========================================
#181108
Attachments:
Moderators: ForumSupporttomeperica
Time to create page: 0.061 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