There are times when we might need to work on forms that show and validate fields depending on a users selected input. For example an account registration form, with two types of account:

Individual

When the user selects individual, show:

First name

Last name