0
's1pdtCalc'값을 null로 허용하고 레코드를 저장할 수 있도록 허용해야합니다. 지금 "s1pdtCalc가 null이거나 개체가 아닙니다"라는 오류 메시지가 나타납니다. 도움을 주셔서 감사합니다. 여기 코드가 있습니다.Ext JS 자바 스크립트 Null 값 유효성 검사
function validateForm(values) {
var pass = true;
// check percent days turnaround
var ck = values.s1pdtCalc.toString();
if (ck > "") {
var t1 = values.s1pdtNTTd.toString(); //NEMIS Turn around
var t2 = values.s1pdtTAd.toString(); //NEMIS Turn adjustment
var t3 = values.actDays.toString(); //NEMIS Turn adjustment
t1 = (t1!=null?t1.trim():0);
if (ck == "MINUS") {
if ((t1-t2) > t3) {
errorMsgs += '<br /> s1pdtATT - Percent days turnaround < 4.0.0. exceeds the number of activation days';
}
}
else {
if ((t1+t2) > t3) {
errorMsgs += '<br /> s1pdtATT - Percent days turnaround < 4.0.0. exceeds the number of activation days';
}
}
}
if (errorMsgs > "") {
pass = false
}
return pass;
}
감사합니다. – michael