Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
1

Fillable form calculations stopped working

Enthusiast ,
Jun 29, 2023 Jun 29, 2023

I am working on a fillable order sheet with active fields of amt-1, case-price-1, with ascending numbers for each succeding amt and case-price fields, and total with total being the product of the amount x price fields. I had to use a script provided by a commenter in a couple of places where the default calculaitons would not work and it works well. I managed to get 14 lines where the total worked well with the default calculation or the script. I would update the script with the approiate fields when applying it.

Now I have hit a spot past those 14 lines in which neither the default or script calculations will work in the total field.

The script is:

var v1 = Number(this.getField("amt15").valueAsString);
var v2 = Number(this.getField("caseprice15").valueAsString);
event.value = v1 * v2;

I am facing a deadline and am now apparently dead in the water since nothing I enter seems to be working. Does anyone have any ideas?

Thsnks to those who know more than me,

Joe

TOPICS
JavaScript , PDF forms
1.8K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jun 29, 2023 Jun 29, 2023

There are four lines (records?) where the total is not working. So I skipped lines and started a new total further down the sheet that works fine with the default calculations. Not sure what that means, if anything, but one never knows.

Thanks,

Joe

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 29, 2023 Jun 29, 2023

There is no reason built in calculation wouldn't work for this, can you share your file?

Also check console for any errors.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jun 29, 2023 Jun 29, 2023

Yes, I will cover proprietry information and leave the neccessary info which are the amount, case price and total are visible. Thanks for your interest.

Joe

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jun 29, 2023 Jun 29, 2023

I have done fillable forms before, but as cnoy as omplex as this. My knowledge of scripting is pitiful; The only thing I know is to copy and paste where the experts say --- and figure out where the varibles are to adapt them to differnt input.

Thanks again forf your interest,

Jjw

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 30, 2023 Jun 30, 2023

Check the Javascript console for errors.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jun 30, 2023 Jun 30, 2023

How is that done?

thanks,

Joe

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 30, 2023 Jun 30, 2023

Ctrl+J after editing the value of one of the fields.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jun 30, 2023 Jun 30, 2023

In one of the fields where the total function does not work, I do the ctrl-j command and get this report on the default and script total calculations:


TypeError: f is null
1282:byteCodeTool
TypeError: f is null
1282:byteCodeTool
TypeError: f is null
1282:byteCodeTool
TypeError: f is null
1282:byteCodeTool
TypeError: f is null
1282:byteCodeTool
TypeError: f is null
1282:byteCodeTool
TypeError: f is null
1282:byteCodeTool
TypeError: f is null
1282:byteCodeTool
TypeError: f is null
1282:byteCodeTool
TypeError: f is null
1282:byteCodeTool
TypeError: f is null
1282:byteCodeTool
TypeError: f is null
1282:byteCodeTool
TypeError: f is null
1282:byteCodeTool
TypeError: f is null
1282:byteCodeTool

I do not know what this means or how to fix it. 

Thanks,

Joe

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 30, 2023 Jun 30, 2023

Somewhere you use a field name for which no field exists. This can happens when you change field names without changing the calculations. Check the calculations in your form.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jun 30, 2023 Jun 30, 2023

Thank you!!

Joe

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jun 30, 2023 Jun 30, 2023
LATEST

Bernd, I checked my field names and made sure they matched. Also changed field names and made certain those matched. I did both with the default calculation and the script and neither would return a total in the total field, and in some cases ignored the currency format I selected. Is there a possibility of another problem?

Thanks,

Joe

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