Jump to content
  • 0
Marshall

Using division in forms.

Suggestion

Marshall

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.

Edited by Marshall

Share this post


Link to post
Share on other sites

2 replies to this suggestion

Recommended Posts

Mark Irwin

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

Share this post


Link to post
Share on other sites
Marshall

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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

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