How to show hide other content fields when we select radio buttons? I have created 2 radio buttons. When i select 1 radio button, then represented field has to display and hide other field represented to next radio button.
When I select radio1, only textfield1 has to display and radio2, only textfield2 has to display.
This could also be done by using states that are available in Drupal core. For example you could set that an element in a form should only be visible if another element has the value "x".

    $form['my_element']['#states'] = array(
      'visible' =&gt; array(
        ':input[name="some_other_element"]' =&gt; array('value' =&gt; 'some_value_that_has_to_be_set'),
      ),
    );


More examples at form_example_states_form.

You can add states to elements in an implementation of hook_form_alter or add it directly to the form if you are programming it yourself.