Autofill fields on profile form based on previous fields
You will have to use JavaScript to dynamically copy information from those fields. Depending on the structure of your form, you could also use a form_alter() to assign data- attributes to fields, which will reduce the number of lines of JS and make maintaining easier.

Here's sample code that should explain the idea::

JS:

$('input[data-sync]').change(function() {
  // Including the selector in data-attribute of the field will allow you
  // to have both - IDs and classes out of the box. This means you can
  // change the values of multiple fields, after only one change.
  $($(this).attr('data-sync-target')).val($(this).val());
});


hook_form_alter():

/**
 * Implements hook_form_alter().
 */
function MYMODULE_form_alter(&amp;$form, &amp;$form_state, $form_id) {
  switch ($form_id) {
    case 'your-form-id':
      $form['some_field']['#attributes'] = array(
        'data-sync' =&gt; TRUE,
        // You would use this to target an element with ID.
        'data-sync-target' =&gt; '#target-element-id',
        // OR you can use this to target multiple elements with this class.
        'data-sync-target' =&gt; '.target-element-class',
      );
      // If necessary, you can add custom CSS classes to elements like so:
      $form['some_field']['#attributes']['class'][] = 'your-special-class';
      break;
  }
}