How to conditionally pass data from one form to another?