Auto-populate feeds source from target (code inside)

This is a very simple thing I made when I had to map several fields in feeds that had identical column names in the CSV being imported. In your example.module:

<?php
/**
 * Implements hook_form_alter().
 */
function example_form_alter(&$form, &$form_state, $form_id) {
  switch (
$form_id) {
    case
'feeds_ui_mapping_form':
     
drupal_add_js(drupal_get_path('module', 'example') . '/js/example.js');
      break;
  }
}
?>

And the example.js file:

/**
* @file
* JS Magic for feeds.module.
*/

(function ($) {
  /**
   * Main loop.
   */
  Drupal.behaviors.example = {
    attach: function (context, settings) {
      $(document.body).once('example-feeds', function(){
        $('#edit-target').on('change', function() {
          var $selected = $(this).find('option:selected').text();
          $('#edit-source').val($selected);
        });
      });
    }
  };
}(jQuery));

Joshua Walker