如果另一个字段包含数据,我有这个 javascript 在我的 PDF 表单中运行良好,可以根据需要设置一个字段。但是,我想让它忽略测试的“0.00”值。但我不知道这/^\s*$/
意味着什么,更不用说如何根据我的情况更改脚本了。
var rgEmptyTest = /^\s*$/;
// t is the value to be tested and f is the field to set accordingly
function testMyField (t, f) {
if (rgEmptyTest.test(t)) {
this.getField(f).required = false;
} else {
this.getField(f).required = true;
}
}
谢谢!