Support form prefilling with query params

This commit is contained in:
bumi 2020-10-18 22:28:46 +02:00
parent f1a0278c10
commit f30bb63bad
1 changed files with 7 additions and 0 deletions

View File

@ -128,6 +128,13 @@
<script src="/lnme/lnme.js" id="lnme-script"></script>
<script>
var urlParams = new URLSearchParams(window.location.search);
if (urlParams.get('amount')) {
document.getElementById('amount').value = urlParams.get('amount');
}
if (urlParams.get('memo')) {
document.getElementById('memo').value = urlParams.get('memo');
}
document.getElementById('send-button').addEventListener('click', function(e) {
e.preventDefault();
e.target.setAttribute('disabled', true);