Jump to content
  • 0

Using division in forms.


Marshall Brown

Suggestion

Marshall Brown
Posted

I would really like to see division added to the calculations allowed in forms. It would seem that the coding to allow this must be in Nitro Pro since it does do averages which, of course, requires division by the number of items being averaged. I'd even be happy if I could locate the code or someone who has already confronted this problem. So far Google hasn't helped.

2 replies to this suggestion

Recommended Posts

Posted

I do division this way, in the form that i use I have 2 fields one called "ounces" and one called "pounds" and I put this in the custom calculation script box.

1// Obtain the value from the first field
2 var v1 = getField("Ounces").value;
3 // Obtain the value from the second field
4 var v2 = getField("Pounds").value;
5 // Set this field value equal to the difference
6 event.value = v1 / v2;

it pulls the value out of the ounces field "v1" and then the value from the pounds field "v2" and then divides them and returns the result.

Hope that helps,

Mark

Marshall Brown
Posted

I am almost embarrassed to admit I found out how to do it and it was so simple I thought about turning in my IQ and asking for a new one. Thanks for your help.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.