How can I use logic to build a form?