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

Dropdown menu with export values but I need an item I can input my own value in separate text field

New Here ,
Jun 27, 2021 Jun 27, 2021

Copy link to clipboard

Copied

I am needing help with my form. So I have a dropdown menu (Dropdown 11) that has a large item list, and each item has an export value that populates a different text field (Field 7), and that Field 7 is used in a calculation in another text field (Installation Uncertainty).

 

Now what I am having trouble with is in the first dropdown menu, there is the option to use "Own Instrument" in which doesn't have any export value, because in the second text field (Field 7) the user would write in their own personal numbers. However, since the form exports values from the dropdown menu and commits the selected value immediately, if I put '0' as the 'Own Instrument' export value, it won't let me edit the actual text field (Field 7) to put the correct numbers. And if I don't put any export value for the 'Own Instrument' in the dropdown menu, it says "The value entered does not match the format of the field [ Installation uncertainty ]".

 

 

How do I go about this? All I want to be able to do is to be able to select 'Own Instrument' from my dropdown menu, and be able to edit the text field 'Field 7' say with a number, for example - 0.675, and that number is used automatically in the calculation in the 'Installation Uncertainty' field. Please refer to my video below where I show you what's going on.

TOPICS
Edit and convert PDFs , General troubleshooting , How to , JavaScript , PDF forms

Views

844

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
community guidelines
Community Expert ,
Jun 27, 2021 Jun 27, 2021

Copy link to clipboard

Copied

LATEST

++Edited Reply; lchanged the last line of the script to "" instead of event.target.value

 

The video wasn't very helpful for me in determining what exactly are these fields calculating; what type of calculations are these? (built-in "Value is", Simplified Field Notations, or custom calculated script)

 

And Which are the fields that are actually executing any calculating events?

 

For instance, going back at the first few seconds of the video, when you selected the item "Hioki TPW01" from Dropdown 11, the value that is automatically calculated  in the "Total Uncertainty" field is 0.454.

 

Yet, soon after that you selected the item "Own Instrument" from that same dropdown menu, and the value of "0.00" is populated in Field 7; the resulting calculated value  in the "Total Uncertainty" field becomes 0.090.

 

This denotes that the value that is already present in the "Installation Uncertainty" field ".090" is added with whatever value is present in Field 7.

 

However, that calculation appears only to be true IF or WHEN the value of "0.00" is present in Field 7; that calculation is not true if the value in Field 7 is 0.445, for example. 

 

Your video shows that when 0.445 is populated in Field 7, the "Total Uncertainty" field populates a value of "0.454". 

 

That is incorrect if the "Installation Uncertainty" field has a permanent value of ".090".

 

You only get a sum value of "0.454" in the "Total Uncertainty" ONLY if the "Installation Uncertainty" field changes its value to "0.009".

 

In any case, I recreated the scenario on  my end and employed a custom calculation script in Dropdown 11:

 

 

 

var f =  event.target;

if(event.source&&event.source.name =="Dropdown 11") {

if(f.value !== 0.00)this.getField("Field 7").value = f.value;

else if(f.value == 0.00)this.getField("Field 7").value = "";

}

 

 

 

This  resolves the issue of  "0.00" automatically populating a in  Field 7 and reverting back to "0.00" as the user continue to work with other fields.

 

 

So, please elaborate or share an example of this file to see what exactly are the steps that you could be missing or need corrections.

Votes

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
community guidelines