The value entered does not match the format of the field

Community Beginner ,
Jul 11, 2017

Copy link to clipboard

Copied

I have set up some basic formulas in my PDF.  Example....I have a Swing field and a Cycles field.  In the Cycles field under calculate I have a Simplified field notation:  (60*60)/Swing  The formula works fine but I have to have a number in Swing or it gives me a The value entered does not match the format of the field [Cycles]  - the format in Cycles is set up as a Number.  What do I need to change to be able to have a blank in Swing?

Adobe Community Professional
Correct answer by Karl Heinz Kremer | Adobe Community Professional

JavaScript for Acrobat is not the same as JavaScript for the web - that makes it a bit harder to find a good resource. Take a look here for a book that is dedicated to Acrobat's JavaScript: Beginning JavaScript for Adobe Acrobat

Here are some general resources: Learning to Program JavaScript for Adobe Acrobat - KHKonsulting LLC

Then, once you are familiar with JavaScript, you need to work with the Acrobat JavaScript documentation in the Acrobat SDK.

The "Maximum" field should be fine, but take a look at the script for Efficiency, and convert that to something similar to what I presented above.

TOPICS
Acrobat SDK and JavaScript, Windows

Views

4.8K

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

The value entered does not match the format of the field

Community Beginner ,
Jul 11, 2017

Copy link to clipboard

Copied

I have set up some basic formulas in my PDF.  Example....I have a Swing field and a Cycles field.  In the Cycles field under calculate I have a Simplified field notation:  (60*60)/Swing  The formula works fine but I have to have a number in Swing or it gives me a The value entered does not match the format of the field [Cycles]  - the format in Cycles is set up as a Number.  What do I need to change to be able to have a blank in Swing?

Adobe Community Professional
Correct answer by Karl Heinz Kremer | Adobe Community Professional

JavaScript for Acrobat is not the same as JavaScript for the web - that makes it a bit harder to find a good resource. Take a look here for a book that is dedicated to Acrobat's JavaScript: Beginning JavaScript for Adobe Acrobat

Here are some general resources: Learning to Program JavaScript for Adobe Acrobat - KHKonsulting LLC

Then, once you are familiar with JavaScript, you need to work with the Acrobat JavaScript documentation in the Acrobat SDK.

The "Maximum" field should be fine, but take a look at the script for Efficiency, and convert that to something similar to what I presented above.

TOPICS
Acrobat SDK and JavaScript, Windows

Views

4.8K

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Jul 11, 2017 0
Adobe Community Professional ,
Jul 11, 2017

Copy link to clipboard

Copied

When there is no value in the "Swing" field, the value returned for an empty string is 0, which means you are dividing by zero - which results in "NaN" - or "Not a Number". This is - as the name suggests - not a number, and therefore does not fit into the number format that you associated with the field. There are two ways around this: You can either use a custom formatting script for your result field, or you can use a custom calculation script that will not perform the calculation when there is no valid number in the "Swing" field. I would go with the second route. Something like this should work:

var f = this.getField("Swing");

if (f.valueAsString != "") {

  event.value = (60*60)/f.value;

}

else {

  event.value = "";

}

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 11, 2017 1
Community Beginner ,
Jul 11, 2017

Copy link to clipboard

Copied

The calculations are still working using that, but I still can't change Swing to a blank field.  I'm getting the value entered does not match the format of the field [Efficiency]

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 11, 2017 0
Community Beginner ,
Jul 11, 2017

Copy link to clipboard

Copied

I think I'm finding my problem.  I am very inexperienced in JavaScript.  What I have done is convert an excel file to PDF and am trying to program 3 fields.  The first field will be filled in by the user with a number (however I want it blank to start).  I've labeled that Swing.  That will then calculate Cycles (60*60)/Swing.  The next field they will enter is labeled Bucket.  The field I call Maximum will calculate Cycles*Bucket.  Finally They will enter Volume in one field (named Volume) and Hours into another field (named Hours)  The final box is Efficiency, which calculates the total of Volume/Hours/Maximum.  I'm thinking I will need to write a custom calculation script for all 3 boxes or they will be off.  I plan to convert several things from excel to fillable pdf's and will need to learn how this works.  Is there a course you recommend?  Any help you can offer would be greatly appreciated for this form.  I have all the formula's working fine..but just can't clear all the boxes to start with a blank form.  

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 11, 2017 0
Adobe Community Professional ,
Jul 11, 2017

Copy link to clipboard

Copied

JavaScript for Acrobat is not the same as JavaScript for the web - that makes it a bit harder to find a good resource. Take a look here for a book that is dedicated to Acrobat's JavaScript: Beginning JavaScript for Adobe Acrobat

Here are some general resources: Learning to Program JavaScript for Adobe Acrobat - KHKonsulting LLC

Then, once you are familiar with JavaScript, you need to work with the Acrobat JavaScript documentation in the Acrobat SDK.

The "Maximum" field should be fine, but take a look at the script for Efficiency, and convert that to something similar to what I presented above.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 11, 2017 1
Community Beginner ,
Jul 12, 2017

Copy link to clipboard

Copied

Karl.....thank you so much for your time!!!!  I'm plugging away again this morning.  I've tried this but am getting a SyntaxError.

The code I'm trying is:

var f = this.getField("Volume"Hours"Maximum");

if (f.valueAsString !="") {
  event.value =

(Volume/Hours/Maximum)/f.value;
}
else {
  event.value = "";
}

Is there any way I can attach the PDF so you could look at it, so it makes more sense?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 12, 2017 0
Adobe Community Professional ,
Jul 12, 2017

Copy link to clipboard

Copied

"Volume"Hours"Maximum" is not a field name.

What is this: (Volume/Hours/Maximum) ?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 12, 2017 0
Community Beginner ,
Jul 12, 2017

Copy link to clipboard

Copied

My PDF has 3 boxes that have calculations in them.

The final box I am trying to write code in is labeled efficiency.  That needs to calculate 2 fields that are entered by the user.  One field is called Volume, one is called Hours.  Efficiency is calculating the value of Volume divided by Hours divided by the field we got from the first code called Maximum.

I was trying to play with the previous code...but know I'm not doing it properly.  Any help is very much appreciated!  😃

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 12, 2017 0
Adobe Community Professional ,
Jul 12, 2017

Copy link to clipboard

Copied

You need to get the three values independent - you cannot combine the filed names as you did. Try something like this:

var volume = this.getField("Volume").value;

var hours = this.getField("Hours").value;

var maximum = this.getField("Maximum").value;

Then you can use the variables volume, hours and maximum in your calculation:

event.value = volume / hours / maximum;

Do yourself a favor and read up on the syntax of JavaScript, it will make your life much easier if you know what is valid and what will cause errors - and if something does report an error, you might be able to figure out why it's complaining about a certain construct. You cannot copy and paste your way to a successful solution. You need to be able to understand what the code snippets you find online are actually doing so that you can adjust them to your specific needs - or fix something half a year down the line when the requirements change.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 12, 2017 2
Community Beginner ,
Jul 12, 2017

Copy link to clipboard

Copied

Thank you again for helping!  I will definitely read up on the syntax of JavaScript.  I am now able to clear the fields without error codes...however, my formula is not working properly.  My Cycles and Maximum are computing properly...but Efficiency is not doing any calculations.  I am missing something.

var volume = this.getField("Volume").value;
var hours = this.getField("Hours").value;
var hours = this.getField
("Maximum").value;

if (Volume.valueAsString !=""){event.value = Volume/Hours/Maximum}
if (Hours.valueAsString !="")
{event.value = Volume/Hours/Maximum}
if (Maximum.valueAsString !="") {event.value = Volume/Hours/Maximum}

event.value = volume/hours/maximum;

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 12, 2017 0
Community Beginner ,
Jul 12, 2017

Copy link to clipboard

Copied

Karl!

I did it!  I messed with a few things!  Thank you so much!  Here's what I did:

var Volume = this.getField("Volume").value;
var Hours = this.getField("Hours").value;
var Maximum = this.getField("Maximum").value;

if (Volume.valueAsString !=""){event.value = Volume/Hours/Maximum}
if (Hours.valueAsString !="")
{event.value = Volume/Hours/Maximum}
if (Maximum.valueAsString !="") {event.value = Volume/Hours/Maximum}

event.value = Volume/Hours/Maximum;

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 12, 2017 0
Community Beginner ,
Jul 12, 2017

Copy link to clipboard

Copied

Opps....I spoke too soon.  I'm going to step away from this for a tad and clear my head.  I'll keep you posted.  I am also reading your write up. 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 12, 2017 0
Adobe Community Professional ,
Jul 12, 2017

Copy link to clipboard

Copied

There is a problem with your code:

When you call this.getField("Some Field Name"), this method will return a field object. Such a field object has a number of properties, and some methods (what exactly that means will become clearer once you get a better understanding of JavaScript). For now, let's take a look two of these properties: "value" and "valueAsString" - the first one will interpret the value based on the context you are calling it from and will either return a number or a string (at least in your example). The latter one will always return the value as a string. You are setting your "Volume", "Hours" and "Maximum" variables to the value property of the field, however, further down you are trying to at the "valueAsString" property from your variable e.g. "Volume". At this point, it's not a field object, it's a number or a string and does not have a "valueAsString" property. Also, JavaScript is case sensitive, so "volume" is different from "Volume".

To make things work a bit better, you need to modify your code:

var volume = this.getField("Volume");

var hours = this.getField("Hours");

var maximum = this.getField("Maximum");

if (volume.valueAsString != "" && hours.valueAsString != "" && maximum.valueAsString != "") {

  event.value = volume.value / hours.value / maximum.value;

}

else {

    event.value = "";

}

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 12, 2017 2
Most Valuable Participant ,
Jul 12, 2017

Copy link to clipboard

Copied

This is the code to use:

var Volume = Number(this.getField("Volume").valueAsString);

var Hours = Number(this.getField("Hours").valueAsString);

var Maximum = Number(this.getField("Maximum").valueAsString);

if (Hours!=0 && Maximum!=0) event.value = (Volume/Hours)/Maximum;

else event.value = "";

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 12, 2017 0
Most Valuable Participant ,
Jul 12, 2017

Copy link to clipboard

Copied

Note I edited the code above slightly...

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 12, 2017 0
Community Beginner ,
Jul 12, 2017

Copy link to clipboard

Copied

Thank you both!  Karl, I still kept getting an error with yours (but the figures worked great!) however Try67's worked for me.  I can't thank you both enough!  You both are pro's at this.  I'm hoping to learn as much as I can.

I have one final PDF that I'm working on and have figured out pretty much the whole thing.  It is very similar to the first one that now works perfectly.

My second one has almost the same format....3 boxes that are programmable based off entries.  I know I have the first box called Maximum computed properly.  My second box however is where I KNOW I need to put in JavaScript but I believe I am messing up on the formula.  This field takes the value of Maximum and multiplies that by the amount the user enters into Bucket then it divides that by what the user enters into Depth multiplied by Width and divides that total by 27.   example:  (Maximum*Bucket) / ((Depth*Width)/27)

This is what I have done so far:

var Bucket = Number(this.getField("Bucket").valueAsString);

var Depth = Number(this.getField("Depth").valueAsString);

var Width = Width(this.getField("Width").valueAsString);

var Maximum = Maximum(this.getField("Maximum").valueAsString);

I'm thinking the next line would be:

if (Width!=0 && Maximum!=0) event.value = (Maximum*Bucket)/Depth*Width)/27;

else event.value = "";

BUT....I'm getting a SyntaxError. 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 12, 2017 0
Adobe Community Professional ,
Jul 12, 2017

Copy link to clipboard

Copied

There is a problem in this line:

event.value = (Maximum * Bucket) / Depth * Width) / 27;

The number of opening "(" and closing ")" does not match - they have to always be in pairs. I assume you want this:

event.value = (Maximum * Bucket) / (Depth * Width) / 27;

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 12, 2017 0
Community Beginner ,
Jul 12, 2017

Copy link to clipboard

Copied

I'm no longer getting an error code...but it is not computing anything.

var Bucket = Number(this.getField("Bucket").valueAsString);

var Depth = Number(this.getField("Depth").valueAsString);

var Width = Width(this.getField("Width").valueAsString);

var Maximum = Maximum(this.getField("Maximum").valueAsString);

if (Width!=0&&Maximum!=0)event.value=(Maximum*Bucket)/(Depth * Width)/27;

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 12, 2017 0
Most Valuable Participant ,
Jul 12, 2017

Copy link to clipboard

Copied

You can't just invent things and expect them to work... Why did you replace Number(...) with Width(...) and Maximum(...)? There are no such functions in JS.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 12, 2017 1
Community Beginner ,
Jul 12, 2017

Copy link to clipboard

Copied

I get a SyntaxError: missing ) after argument list 4: at line 5.

Also....my calculation should be (Maximum*Bucket) / (Depth*Width/27) to factor properly.  What am I missing?

Again! Thank you for helping me!!!

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 12, 2017 0
Community Beginner ,
Jul 12, 2017

Copy link to clipboard

Copied

I figured it out!~   Thanks to your help!  I'm just finishing the last box...I should be all set!  Thank you both for putting up with a novice!!!!

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 12, 2017 0
Community Beginner ,
Jul 12, 2017

Copy link to clipboard

Copied

I hadn't even noticed I'd done that!  And that did make a huge difference.  Thanks again for all your tips and help!  I actually understand a lot more now!  I have a lot to learn!  Have a great afternoon!!!

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 12, 2017 0
Most Valuable Participant ,
Jul 12, 2017

Copy link to clipboard

Copied

In addition to that you have another issue in the code above. You should check whether Width and Depth are not zero, not Width and Maximum.

If Maximum is zero then you're dividing zero by a value, which is fine, but if Depth is zero you'll be dividing by zero, which is not allowed.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 12, 2017 1
Community Beginner ,
Jul 13, 2017

Copy link to clipboard

Copied

Thank you!  I fixed the code with your advice.  How long have you been writing code?  How did you learn?  Again, Thank you for your help with this!  I'm interested in learning more.  We have several excel programs that would work better in Adobe. 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 13, 2017 0
Most Valuable Participant ,
Jul 13, 2017

Copy link to clipboard

Copied

I've been writing code for Acrobat for more than a decade now, and code in general about twice that.

I taught myself JavaScript for Acrobat (and other Adobe applications), by trial and error, by following the good advice given by experts on these forums (and others, now mostly defunct), as well as by reading the API and parts of the PDF Specifications.

Some good resources to get you started:

http://www.adobe.com/devnet/acrobat.html

https://acrobatusers.com/tutorials/

http://www.pdfscripting.com/

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 13, 2017 1
Community Beginner ,
Jul 21, 2017

Copy link to clipboard

Copied

Good Morning,

I have the PDF's calculating fine.  We sent them out to the guys on the field, they all have IPADS....and they can not get it to work.  I have tried downloading Adobe...and it will now let me fill in the fillable fields..but the calculations will not work.  What program can we use to have the calculations work on Ipads?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 21, 2017 0
Most Valuable Participant ,
Jul 21, 2017

Copy link to clipboard

Copied

Your best chance is with Readdle's PDF Expert, but even then it might not work, as support for scripts on mobile devices is very (very) limited.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 21, 2017 0
Adobe Community Professional ,
Jul 21, 2017

Copy link to clipboard

Copied

As try67 said, there are 3rd party PDF viewers that have more support for custom calculations than Adobe's mobile Reader. Designing a form and then trying to find a mobile PDF viewer is the wrong order: You need to first pick what PDF viewers you want to support (e.g. on desktop, iOS and Android platforms), and then design your form so that it only uses the subset of features that are supported by all viewers.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 21, 2017 0
New Here ,
Aug 09, 2017

Copy link to clipboard

Copied

I need help with a code as well. I form PDF that has many fields to fill in but to feels that have current monthly salary (CMS) and new monthly salary (NMS) but i need to know what the percent increase it would be. I have this basic javascripts (NMS-CMS)/CMS its me the total percent. But if I enter something first I get this message first: The value entered does not match the format of the field. Please help me that I don't get this message first before I start typing something else before putting the salary information.

Thank you!

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 09, 2017 0
Most Valuable Participant ,
Aug 09, 2017

Copy link to clipboard

Copied

Did you read the discussion above? The reason for this error message and the solution are described in it.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 09, 2017 0
New Here ,
Aug 09, 2017

Copy link to clipboard

Copied

I tried doing that but it's not working. When I enter something I get this error. But if I enter the salary amount first I don't get this error anymore.

This is Field notation I added (NMS-CMS)/CMS for the Percent Box

17 PAF for CAPPS HR.jpg

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 09, 2017 0
Most Valuable Participant ,
Aug 09, 2017

Copy link to clipboard

Copied

You need to use a custom calculation script that makes sure that the "CMS" field is not empty or equals to zero before performing the calculation.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 09, 2017 0
New Here ,
Aug 09, 2017

Copy link to clipboard

Copied

Would you be able to help me with that? Please let me know. Thanks

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 09, 2017 0
Most Valuable Participant ,
Aug 09, 2017

Copy link to clipboard

Copied

Use this code:

var v1 = Number(this.getField("NMS").value);

var v2 = Number(this.getField("CMS").value);

var v3 = Number(this.getField("CMS").value);

if (v3==0) event.value = "";

else event.value = (v1-v2)/v3;

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 09, 2017 0
New Here ,
Aug 09, 2017

Copy link to clipboard

Copied

Thank you so much! It worked!!!

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 09, 2017 0
New Here ,
Aug 11, 2017

Copy link to clipboard

Copied

The code help me what I needed but i am across this problem. How would I fix this?

If I enter current monthly salary (CMS) of $6,000.00 and there was no change to monthly salary but I wanted to leave New monthly salary (NMS) blank or put 0.00 in the field the percent box gives me -100.0%. (first screen shot)

If i do it the opposite way and do $6,000.00 in new monthly salary (NMS) and put a blank field or 0.00 in the current monthly salary (CMS) I get 0.00%. (second screen shot) How can I get this to happen with the other problem.

I still like the current code because it is giving me the percentage of what I need as you can see in 3rd screen shot.

Current code:

  1. var v1 = Number(this.getField("NMS").value); 
  2. var v2 = Number(this.getField("CMS").value); 
  3. var v3 = Number(this.getField("CMS").value); 
  4. if (v3==0) event.value = ""
  5. else event.value = (v1-v2)/v3; 

Please let me know if you can help me.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 11, 2017 0
Adobe Community Professional ,
Aug 11, 2017

Copy link to clipboard

Copied

-100% in the first screenshot is correct.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 11, 2017 0
New Here ,
Aug 15, 2017

Copy link to clipboard

Copied

What if I wanted the percent box be 0.00% how can I changed the code:

  1. var v1 = Number(this.getField("NMS").value);
  2. var v2 = Number(this.getField("CMS").value);
  3. var v3 = Number(this.getField("CMS").value);
  4. if (v3==0) event.value = "";
  5. else event.value = (v1-v2)/v3;

Please let me know.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 15, 2017 0