Hidden Required Field

Posted by awbranch on 13-Mar-2014 13:09

Hi,

I have a field that is conditionally hidden based on a picklist selection using rbf_showOrHideSection. When its visible, I want it to be required, but when hidden I don't want it to be. Problem is, right now when hidden, if left blank the user will get an error message that they can't see. Ideally there would be a function like rbf_setFieldRequired(fieldName, required) that could be turned on or off.

One possibility that may work would be filling it in with some dummy value when hidden, but because this field is an email address and it must be unique, that's overly complicated. I'd have to come up with some globally unique dummy email address to place in the field.

Posted by Laurent on 21-Mar-2014 12:29

One thing you can do is to use field-level validation. You do that by going to the object definition, going to the desired field, clicking on the "Validation" link.

From there, you can write some JavaScript that can determine whether you want to enforce a required value or not (the page shows some JavaScript samples)

All Replies

Posted by Jean Richert on 17-Mar-2014 06:11

Hi Awbranch, I noticed your question hasn't been answered yet. I'll check if someone could assist you in a timely manner.

Posted by Laurent on 21-Mar-2014 12:29

One thing you can do is to use field-level validation. You do that by going to the object definition, going to the desired field, clicking on the "Validation" link.

From there, you can write some JavaScript that can determine whether you want to enforce a required value or not (the page shows some JavaScript samples)

This thread is closed