I’m using the Moralis demo on
So I’m able to initiate a transfer after User authentication via Walletconnect but I’d love the transfer amount to be defined by the user.
I introduced an input form with Id “amountOfETH” and tried to replace the amount value with the input of the form. But that doesn’t work. It doesn’t pass the inputed amount. How do I make the transfer function to work with user defined amount???
<script>
function runcode(){
Moralis.transfer({type:"native", receiver:"0x...",amount:Moralis.Units.ETH(document.getElementByid('amountOfETH').value)});
}
</script>
<main>
<section class="buttons">
<button id="btn-auth">Connect Wallet</button>
<button id="btn-auth" value="click" onclick="runcode()">Pay Now</button>
</main>
<!-- scripts -->
<script src="script.js"></script>