Uncaught ReferenceError: calcAll is not defined
Posted: 02 Aug 2017
Why am I getting the following error:
Uncaught ReferenceError: calcAll is not defined
calcAll is defined in the Javascript window for the form.
It is called from the OnClick of the Save button (buttons turned on).
**** Javascript ****
**** Save OnClick ****
Uncaught ReferenceError: calcAll is not defined
calcAll is defined in the Javascript window for the form.
It is called from the OnClick of the Save button (buttons turned on).
**** Javascript ****
Code: Select all
function convertDecimalToDegree(data) {
data.degree = Math(Math.trunc(data.decimal));
data.minutes = Math.abs((data.decimal - Math.trunc(data.decimal))*60);
data.seconds = (data.minutes - Math.trunc(data.minutes))*60;
}
function calcLatitude(){
var data = {"decimal" : fd.field("GpsLatitude").value(),
"degree" : 0,
"minutes" : 0,
"seconds" : 0};
convertDecimalToDegree(data);
var compass = data.decimal < 0 ? "S" : "N";
var text = data.degree + '°' + data.minutes.toFixed(1) + "'" + data.seconds.toFixed(1) + '"' + compass;
fd.field("GpsLatitudeText").value(text);
}
function calcLongitude(){
var data = {"decimal" : fd.field("GpsLongitude").value(),
"degree" : 0,
"minutes" : 0,
"seconds" : 0};
convertDecimalToDegree(data);
var compass = data.decimal < 0 ? "W" : "E";
var text = data.degree + '°' + data.minutes.toFixed(1) + "'" + data.seconds.toFixed(1) + '"' + compass;
fd.field("GpsLongitudeText").value(text);
}
function calcAll(){
calcLatitude();
calcLongitude();
}
**** Save OnClick ****
Code: Select all
calcAll();