Moralis Transfer User defined Amount

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>

Hi @EncodTech

Please share the input element code :man_mechanic:

Seems Iā€™m not able to post a div tag

Take a look at READ BEFORE POSTING - How to post code in the forum

<div class="form-group col-md-12">
      <input type="number" step="0.01" class="form-control" id="amountOfETH"
      placeholder="How much ETH?">
    </div>

you can try to debug it to see why it doesnā€™t work:

you can use a console.log(Moralis.Units.ETH(document.getElementByid('amountOfETH').value))
also a console.log(document.getElementByid('amountOfETH').value) to see what values you have there.

You can also look in your browser console to see if you have any errors