I only want to require a field if the user has not checked a check box elsewhere on the form.
The checkbox's value is "Yes" if checked or "No" if not checked.
On the Edit Box's validation formula I have the computed SSJS:
getComponentValue("SoleSource") == "No"
the function is stored in as a JS source
function
getComponentValue(id){
var
field = getComponent(id);
var
value = field.getSubmittedValue();
if
(
null
== value ){
value = field.getValue();
}
return
value
}
No matter if the checkbox (with the ID "SoleSource") is checked or not, it always returns "No", which is the default value, and attempts to validate my field.
Is there any way to do this without submitting the form first?