I'm trying to make a button on my website which allows people to send Ethereum to a specified address. Once clicked, it should for example pop up a MetaMask window where the user can enter the amount of Eth (and optionally fees) and only needs to click send to make the transaction.
However, as far as I understand the function web3.eth.sendTransaction needs to have already a specified amount of Eth in the value field, or otherwise the amount will simply be 0 and you can't change it anymore. Is there a solution to this?
I already managed to create a button with fixed amounts of Eth, however I'm struggling with a solution where the amount is variable and the user can decide how much he wants to send.
Another idea that I had would be to add a textbox/number box where the user can enter his desired amount of Eth that he wants to send, and to use that in the value field. However, that is above my current knowledge, if anyone would be willing to help me to find a solution, I would be very happy.
Thank you
value
property within the MetaMask UX.