what is a best way to create form with primary and secondary info?

What is a way to create form where user have to fill some primary information and then based on primary info we have to show secondary info.