Set conditional field as mandatory after showing/unhiding

Set conditional field as mandatory after showing/unhiding

I have a service request field that is hidden until the user chooses a specific value on a related field.  [if user type "contractor" then unhide "3rd party assessment" field.]

I need to have the assessment field marked as mandatory, but only when the condition is met and the field is shown to the user.   If I mark it as mandatory in the configuration settings, the user is being required to pick a value even if they did not choose user type "contractor" and the field remains hidden.

Can a script or trigger be used to set the field as mandatory if and only if the condition is met?

                  New to ADSelfService Plus?