Conditional Validation

Is it possible to make validation conditional? For example, if I have a dropdown and a text box on a form field and a certain value is selected in the drop down then I want the text box to be required; otherwise, if that specific value is not selected from the drop down then the text box would not be required.

Thank you.

The easiest way for this most probably is to have two sets of input components (with and without validation) and set Visible depending on a condition.