Input field required based on select

Site: classic asp
Database: MSSQL

I have a form with a select and a hidden input as follows:

If select = x, the input is displayed and I want the input field required
if select <> x, the input will remain hidden and it can’t be required

Show and hide is working fine, just need help with validation only when the field is visible. Thanks!

Community Page
Last updated: