Created
November 10, 2016 23:04
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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