Skip to main content
Participating Frequently
April 16, 2025
Answered

Text field doesnt auto populate and it requires click the text field

  • April 16, 2025
  • 1 reply
  • 1663 views

Hi,

Would like to ask what could be the issue of my form file. 
Lets start with various question having a radio button that has value once clicked. Then each question have another text field that has javascript that gets the value of what u have chose. Then, I have this another box that shows the summation of addition of specific question (in here I only used the built in function calculate of pdf forms). The last is my concern, since it has a javascript condition when the total score reached below 15 it should produce "X" value and when the total reached above 15 it should produce "Z" value. my concern was i need to click/enter the said text field so that the value "X" or "Z" should appear. Is there a way that it could automatically flowdown without clicking or entering? 


Thanks! 

Correct answer try67

Im still encountering a default Y value. Havent selected any in the choice above. id like to have a blank since i havent selected any. I tried revising what you have placed to 
var Ratio = this.getField("FCIK").valueAsString;
if (Ratio=="") {
event.value = " ";

not working as well. 
} else if (Number(Ratio)=0) {
event.value = '0';
} else if (Number(Ratio)>=15) {
event.value = 'X';
} else if (Number(Ratio)<15) {
event.value = 'Y';
}

 


This line is incorrect:

else if (Number(Ratio)=0) {

It should be:

else if (Number(Ratio)==0) {

 

If it still doesn't work share your file, please.

1 reply

Bernd Alheit
Community Expert
Community Expert
April 16, 2025

Where do you use the script?

Participating Frequently
April 16, 2025

I used the script here   The last is my concern, since it has a javascript condition when the total score reached below 15 it should produce "X" value and when the total reached above 15 it should produce "Z" value. 

Just to add I dont use an application, it is pure PDF form. 

try67
Community Expert
Community Expert
April 16, 2025

in the event where the summation is already completed and requires to perform a condition if the said total met specific requirement. Im not sure if I answered your question correctly but i can post my pdf at least? 


No, we mean the actual event of the field: Calculation, Validation, Mouse Up, On Blur, etc.

It would be easier if you could share the actual file with us.