Skip to main content
steft66579364
Known Participant
March 22, 2017
해결됨

I have 4 off fields that have to be filled in with numerical data. All the fields need to to have less than 20, when they are less than 20 each ,a fifth field is filled in automatically with Pass otherwise the fifth field has fail writen into it

Hi,

I have written a script to auto populate a 5th field, I have 4 fields each with less that 20 to be put into them, if all 4 fields have less that 20 (each) then the 5th field is populated with Pass, if any of the 4 fields have more that 20 in it then the 5th field is populated with fail.

I works sort of because if I change the value of var d then I can get pass or fail into the 5th field, if I change any of the other fields there is no change to the 5th field

Can someone help, please

var a = getField("450").value;

var b = +getField("350") .value;

var c = +getField("250").value;

var d = +getField("stroke end0").value;

if (a,b,c,d<=20) {

event.value = "Pass";

} else {

event.value ="Fail";

}

Thank you

이 주제는 답변이 닫혔습니다.
try67
try67답변
Community Expert
March 22, 2017

Replace this line:

if (a,b,c,d<=20) {

With this:

if (a<=20 && b<=20 && c<=20 && d<=20) {

2 답변

try67
Community Expert
try67Community Expert답변
Community Expert
March 22, 2017

Replace this line:

if (a,b,c,d<=20) {

With this:

if (a<=20 && b<=20 && c<=20 && d<=20) {

번역
steft66579364
steft66579364작성자
Known Participant
March 23, 2017

Hi try67,

Thank you ! struggled for days with that.

번역