TOPIC:

Calculating on Form 7 months 5 days ago #254226

  • rkoho
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 49
  • Thanks: 2
Thank you for your superfast reply,

This works perfectly:)

Regards, Reino

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

Calculating on Form 7 months 2 days ago #254447

  • rkoho
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 49
  • Thanks: 2
Hi, one more question:

In my previous formula addition (+) was used to get the final result (C+F). >Now I'd like to use division, which works just replacing (+) with (/). But I want to limit digits to 2 by using 'num.toFixed(2)' . How should I implemet that into the code you provided earlier?

Best, Reino

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

Calculating on Form 7 months 2 days ago #254454

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Posts: 6920
  • Karma: 3
  • Thanks: 493
Hi,

like this:
function ff_nameofyourform_init()
{
setInterval('calc()',500);
} // ff_nameofyourform_init

function calc() {
ff_getElementByName('C').value=Number(ff_getElementByName('A').value)*Number(ff_getElementByName('B').value);
ff_getElementByName('F').value=Number(ff_getElementByName('D').value)*Number(ff_getElementByName('E').value);
var total=
Number(ff_getElementByName('C').value)+Number(ff_getElementByName('F').value);
ff_getElementByName('G').value=total.toFixed(2);
}

Regards,
Tihana

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

  • Page:
  • 1
  • 2
Moderators: ForumSupport
Time to create page: 0.045 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!