Validation and required fields in code

Validation and required fields in code

Hi,

I have a few questions in which when answered a certain way brings up a new question below. Some of these questions I would like to be required fields so they have to answer them but I don't know if that is possible?

I would like to have something in the code like:

( If question = "yes"

Show "new question" and "validate as required field" )   something along those lines but I'm not sure how to or if you can?

Many thanks,

Gill