We can manage display or hide a part of the form based on the user selection from a radio button. One example of this is displaying contact information and at the same place displaying the contact form for the visitor to send a message. Once the visitor clicks the radio button saying contact form the contact details will be replaced with a contact form.
We will be using layers defined by div tags for achieving this effect. We will use on page style sheet to assign styles for the div tag.
We will use one pair of radio buttons and use its onclick event to display one div layer and hide the other div layer. Same way the other radio button will do the opposite. We kept form components inside one div layer and contact details inside other div layer. Based on requirements we can place different components and text inside different layers