Skip to main content
Participating Frequently
April 16, 2025
Answered

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

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! 

try67
try67Correct answer
Community Expert
April 21, 2025

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.

13 replies

Bernd Alheit
Community Expert
Community Expert
April 16, 2025

Where do you use the script?

Translate
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. 

Translate
try67
Community Expert
Community Expert
April 16, 2025

Under what event did you place it, is the question...

Translate