TOPIC:

Berechnung mit 2-Kommastellen 1 month 2 weeks ago #248017

  • tihana.krivic's Avatar
  • tihana.krivic
  • Online
  • Moderator
  • Moderator
  • Posts: 1707
  • Karma: 3
  • Thanks: 154
Hi,

you need to add code in elements, as you added in example from my message above (it is for two elements)

Regards,
Tihana

Please Log in or Create an account to join the conversation.

Berechnung mit 2-Kommastellen 1 month 2 weeks ago #248018

  • Topic Author
  • 1987Jan
  • Offline
  • Senior Breezer
  • Senior Breezer
  • Posts: 103
  • Thanks: 0
So sieht das Formular aus.



Jeder Verbrauch wird einzeln berechnet und soll unten bei Summe "zusammen gerechnet" werden.

Wie kann das am einfachsten umgesetzt werden?
Attachments:

Please Log in or Create an account to join the conversation.

Berechnung mit 2-Kommastellen 1 month 2 weeks ago #248019

  • tihana.krivic's Avatar
  • tihana.krivic
  • Online
  • Moderator
  • Moderator
  • Posts: 1707
  • Karma: 3
  • Thanks: 154
Hi,

like this:
go to your form->Advanced->More options->Scripts->Init.script->check custom->Create code framework and put this:
function ff_NAMEOFFORM_init()
{
setInterval('myCalc()', 500);
} // ff_NAMEOFFORM_init

function myCalc() {
	//Total Sum Calculation 
ff_getElementByName('NAMEOFTOTALSUM').value=Number(0);
	ff_getElementByName('NAMEOFTOTALSUM').value =
		Number(ff_getElementByName('nameofsuma1').value) +
		Number(ff_getElementByName('nameofsuma2').value) + 
                 Number(ff_getElementByName('nameofsuma3').value) + 
             Number(ff_getElementByName('nameofsuma4').value) + 
             Number(ff_getElementByName('nameofsuma5').value) + 
        Number(ff_getElementByName('nameofsuma6').value);
}

Replace:
-NAMEOFFORM with name of your form (not title)
-NAMEOFTOTALSUM with name of your element for total sum (not title)
-nameofsuma1 with name of your element for first suma (not title)
-nameofsuma2 with name of your element for second suma (not title)
-nameofsuma3 with name of your element for third suma (not title)
//and so on

Let me know if it works for you

Regards,
Tihana
The following user(s) said Thank You: 1987Jan

Please Log in or Create an account to join the conversation.

Last edit: Post by tihana.krivic.

Berechnung mit 2-Kommastellen 1 month 2 weeks ago #248022

  • Topic Author
  • 1987Jan
  • Offline
  • Senior Breezer
  • Senior Breezer
  • Posts: 103
  • Thanks: 0
Beautiful

Der Code funktioniert :)DANKE .

Aber noch eine Frage = Wo kommt bei dem letzten Code der Befehl ".toFixed(2)" hin?

Please Log in or Create an account to join the conversation.

Berechnung mit 2-Kommastellen 1 month 2 weeks ago #248026

  • tihana.krivic's Avatar
  • tihana.krivic
  • Online
  • Moderator
  • Moderator
  • Posts: 1707
  • Karma: 3
  • Thanks: 154
Hi,

like this:
function ff_NAMEOFFORM_init()
{
setInterval('myCalc()', 500);
} // ff_NAMEOFFORM_init

function myCalc() {
	//Total Sum Calculation 
ff_getElementByName('NAMEOFTOTALSUM').value=Number(0);
var suma1=Number(ff_getElementByName('nameofsuma1').value);
var suma2=Number(ff_getElementByName('nameofsuma2').value);
var suma3=Number(ff_getElementByName('nameofsuma3').value);
var suma4=Number(ff_getElementByName('nameofsuma4').value);
var suma5=Number(ff_getElementByName('nameofsuma5').value);
var suma6=Number(ff_getElementByName('nameofsuma6').value);
var suma_total=suma1+suma2+suma3+suma4+suma5+suma6;
	ff_getElementByName('NAMEOFTOTALSUM').value = suma_total.toFixed(2);	
}

Regards,
Tihana
The following user(s) said Thank You: 1987Jan

Please Log in or Create an account to join the conversation.

Berechnung mit 2-Kommastellen 1 month 2 weeks ago #248029

  • Topic Author
  • 1987Jan
  • Offline
  • Senior Breezer
  • Senior Breezer
  • Posts: 103
  • Thanks: 0
You're the best !! Thank you very much

Please Log in or Create an account to join the conversation.

Moderators: ForumSupport
Time to create page: 0.139 seconds

BreezingForms Pro 1.4.7 for WordPress Released!

Available in the membership section.

September Discount!

Massive discounts on all subscriptions!

Get Your Subscription Here

Quick Links

Downloads

BreezingForms

ContentBuilder

BreezingCommerce

Templates

Documentation

BreezingForms

ContentBuilder

BreezingCommerce

Apprendre BreezingForms (French Community)

Apprendre et maîtriser BreezingForms par des tutoriels et exemples, le tout en français

breezingforms.eddy-vh.com

Questions et réponses sur les forums de l'AFUJ

AFUJ

Special Offer

Summer Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

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!