diff --git a/CRM/Core/Payment/Stripe.php b/CRM/Core/Payment/Stripe.php
index e5b5a93e3b96bcad51dff54114394e5d4df22a32..27676a38a6b7f42828de831da5afbc11a6c63112 100644
--- a/CRM/Core/Payment/Stripe.php
+++ b/CRM/Core/Payment/Stripe.php
@@ -296,6 +296,7 @@ class CRM_Core_Payment_Stripe extends CRM_Core_Payment {
         'title' => 'Stripe Token',
         'attributes' => array(
           'id' => 'stripe-token',
+          'class' => 'payproc-metadata',
         ),
         'cc_field' => TRUE,
         'is_required' => TRUE,
@@ -306,6 +307,7 @@ class CRM_Core_Payment_Stripe extends CRM_Core_Payment {
         'title' => 'Stripe ID',
         'attributes' => array(
           'id' => 'stripe-id',
+          'class' => 'payproc-metadata',
         ),
         'cc_field' => TRUE,
         'is_required' => TRUE,
@@ -316,6 +318,7 @@ class CRM_Core_Payment_Stripe extends CRM_Core_Payment {
         'title' => 'Stripe Public Key',
         'attributes' => array(
           'id' => 'stripe-pub-key',
+          'class' => 'payproc-metadata',
         ),
         'cc_field' => TRUE,
         'is_required' => TRUE,
diff --git a/js/civicrm_stripe.js b/js/civicrm_stripe.js
index f520c0da269e1de1964ff38f62d248d95895ca85..658e66e40a409cb7fc3dc594d4197117c06f40d0 100644
--- a/js/civicrm_stripe.js
+++ b/js/civicrm_stripe.js
@@ -57,6 +57,16 @@ CRM.$(function($) {
     // We will re-add it if the transaction goes through.
     onclickAction = $submit.attr('onclick');
     $submit.removeAttr('onclick');
+
+    // Quickform doesn't add hidden elements via standard method. On a form where payment processor may
+    //  be loaded via initial form load AND ajax (eg. backend live contribution page with payproc dropdown)
+    //  the processor metadata elements will appear twice (once on initial load, once via AJAX).  The ones loaded
+    //  via initial load will not be removed when AJAX loaded ones are added and the wrong stripe-pub-key etc will
+    //  be submitted.  This removes all elements with the class "payproc-metadata" from the form each time the
+    //  dropdown is changed.
+    $('select#payment_processor_id').on('change', function() {
+      $('input.payproc-metadata').remove();
+    });
   });
 
   // Re-prep form when we've loaded a new payproc