【发布时间】:2013-09-11 19:40:00
【问题描述】:
如果用户没有选中表单其他地方的复选框,我只想要求一个字段。
如果选中,复选框的值为“是”,如果未选中,则为“否”。
在编辑框的验证公式中,我有计算出的 SSJS:
getComponentValue("SoleSource") == "否"
函数存储为 JS 源代码
function getComponentValue(id){
var field = getComponent(id);
var value = field.getSubmittedValue();
if( null == value ){
// else not yet submitted
value = field.getValue();
}
return value;
}
无论复选框(ID为“SoleSource”)是否被选中,它总是返回“No”,这是默认值,并尝试验证我的字段。
有什么方法可以在不先提交表单的情况下做到这一点?
【问题讨论】:
标签: validation checkbox xpages