Need java script for calculating two fields of a Special Arbitrary Format to a Number field
Copy link to clipboard
Copied
I converted an excel sheet to a Form but I need help with Formatting and Calculating with JavaScript.
Need javascript for calculating two fields of a Special Arbitrary Format to a Number field.
[Text1] "004+00" - [Text2] "010+50" = [Text3] "650"
Copy link to clipboard
Copied
What are the actual values of the fields?
Copy link to clipboard
Copied
004+00 - 010+50 = 650
These are references on some engineering alignment sheets that measure distance.
004+00 is 400'
010+50 is 1050'
650 is 650'
Copy link to clipboard
Copied
The Format setting influences what the value of the field looks like, not its actual value.
What does this line of code produce when the value of Text1 is "004+00":
this.getField("Text1").valueAsString
?
Copy link to clipboard
Copied
When I put in this javascript:
event.value = Math.abs(this.getField("Text2").value -
this.getField("Text1").value);
it gives me a error of "The value entered does not match the format of the field [Text3]
Under the format tab
Text1 and Text2 are -Special-Arbitrary Mask-9999+99
Text3 is -Number
Copy link to clipboard
Copied
You didn't answer my question. What is the output of the code I gave you?
Copy link to clipboard
Copied
Copy link to clipboard
Copied
You still didn't answer my question.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Run this code from the JS Console window and let us know what the output is.

