Copy link to clipboard
Copied
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!
Copy link to clipboard
Copied
That's because you placed the code under the Mouse Up event (which is what we asked you about...). Move it to the field's Calculation event, and change it to the following:
var Ratio = this.getField("FCIK").value;
if (Ratio >=15){
event.value = 'X';
}else if (Ratio < 15){
event.value = 'Y';
}
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Where do you use the script?
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Under what event did you place it, is the question...
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Hi,
I created a prototype of my forms created. So to use this I just need to select values from section A and B. Then the total should be placed below. Lastly, my specific concern was the Result portion. The field adjacent to him wasn't reflecting automatically. My work-around here was to manually click the text field box. My question was is there any way that the result should flow down automatically? like there's no clicking needed on it? Thanks
Copy link to clipboard
Copied
That's because you placed the code under the Mouse Up event (which is what we asked you about...). Move it to the field's Calculation event, and change it to the following:
var Ratio = this.getField("FCIK").value;
if (Ratio >=15){
event.value = 'X';
}else if (Ratio < 15){
event.value = 'Y';
}
Copy link to clipboard
Copied
Thanks! Big help!
Copy link to clipboard
Copied
Sir is there any possible way to remove the default answer of the field to blanks?
Copy link to clipboard
Copied
Yes. Use this:
var Ratio = this.getField("FCIK").valueAsString;
if (Ratio=="") {
event.value = "";
} else if (Number(Ratio)>=15) {
event.value = 'X';
} else if (Number(Ratio)<15) {
event.value = 'Y';
}
Copy link to clipboard
Copied
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';
}
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Thanks for this sir!I just did 0 as default. Thanks again