Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save salsalabs/88dffb5e7fdae1baf749e4a446287013 to your computer and use it in GitHub Desktop.
Save salsalabs/88dffb5e7fdae1baf749e4a446287013 to your computer and use it in GitHub Desktop.
Move the amount before the personal information on a donation page. Newer version that uses a tag with a specific ID to indicate that the amount needs to move.
<script type="text/javascript">
// Script to move the donation amount above the personal information.
// Activate this script by adding this line into the Pre Submit Footer:
// <div id="move-amount-before-personal-info"/>
document.addEventListener('DOMContentLoaded', function () {
var flag = document.querySelector('#move-amount-before-personal-info');
var source = document.querySelector('#donation_amount');
var target = document.querySelector('#personal_information');
if (flag != null && source != null && target != null) {
target.parentNode.insertBefore(source, target);
}
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment