Validation and Visible=False fields

Andrew S

New Member
I'm finding that even if a field is not visible it still has to conform to validation rules. This causes a problem when fields need to be validated when visible but ignored when not visible.

Is this the expected behavior? I'd expect that visible=false fields would not be validated. If this is expected behavior and not a bug is there a workaround?

Thanks, Andrew.
 

Dan Peluso

Member
Staff member
Hi Andrew,

This is true and by design. We have a lot of users, internal and external who use validation rules in a lot of interesting ways. Some of those approaches rely on needing to validate even not visible fields. For example, sometimes a validation requires some behind the scenes calculation that is not necessarily appropriate for the user to see. In that case, a validation on a non visible calculated field would make sense.

If you can add some context to what you are trying to do, we may be able to offer some suggestion.
 

Andrew S

New Member
Thanks Dan.

I am counting clock-in and clock-out records to capture job run times. The system does a lookup to see which type of record it's recording and only shows a quantity field when I'm capturing a clock-out record. Both clock-in and clock-out use the same profile. When the last field for clock-in has taken place the form submits. The quantity field should be null for clock-in records (which is working correctly) and the quantity field should be greater than zero for clock-out records. I'd like to be able to switch validation off for the quantity field when it's not showing (ie for a clock in record).
 

Dan Peluso

Member
Staff member
I see.

I think using conditional logic combined with validation would make sense here. Just as a starting point, you could add a conditional logic item for the OnSubmit event that could set a value to a hidden field based on some condition (e.g. "Clock Out" + Qty > 0) and then set a validation on this new hidden field. This is just a high level description of what you should be able to do but there may be other (better) options also.
 
Top