How to create a form with conditional logic