TOPIC:

How to Subtract to field values 7 months 4 weeks ago #267138

  • Topic Author
  • papin0
  • Offline
  • Expert Breezer
  • Expert Breezer
  • Posts: 208
  • Thanks: 0
For example:

Days Available = 10
Days Requesting = 2
Days Remaining = 8

This is what I have but is not working for me
function ff_vacation_days_remaining_action(element, action)
{

var days = ff_getElementByName('number_of_days').value;
var num = ff_getElementByName('number_of_days_requesting').value;

ff_getElementByName('ff_vacation_days_remaining').value = days - num;

} // ff_vacation_days_remaining_action

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

Last edit: Post by papin0.

How to Subtract to field values 7 months 4 weeks ago #267139

  • Mirec's Avatar
  • Mirec
  • Offline
  • Ultimate Breezer
  • Ultimate Breezer
  • Posts: 2957
  • Karma: 2
  • Thanks: 150
Hi,

you can try like this, in init script (Advanced->More Options->Script->init script);
function ff_nameOfForm_init()
{
setInterval('test();',500);

} // ff_QuickForm1947011251_init

function test(){
 var a= ff_getElementByName('a').value;
var b= ff_getElementByName('b').value;
var c= ff_getElementByName('c').value=a-b;

}

->function ff_nameOfForm_init() ->Instead 'nameOfForm' insert name of your FORM!
ff_getElementByName('a').value;
ff_getElementByName('b').value;
ff_getElementByName('c').value; -> instead 'a','b','c' insert name of your elemnt!

Regards,
Mirko

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

How to Subtract to field values 7 months 4 weeks ago #267140

  • Topic Author
  • papin0
  • Offline
  • Expert Breezer
  • Expert Breezer
  • Posts: 208
  • Thanks: 0
Thank you it worked

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

Last edit: Post by papin0.

How to Subtract to field values 7 months 4 weeks ago #267141

  • Mirec's Avatar
  • Mirec
  • Offline
  • Ultimate Breezer
  • Ultimate Breezer
  • Posts: 2957
  • Karma: 2
  • Thanks: 150
Hi,

you're welcome!

If you need more help, let me know!
Regards,
Mirko

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

  • Page:
  • 1
Time to create page: 0.092 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!