How can I display a form field only when certain conditions are met?