I would like to have the clipboard content of the client pasted automatically into a textarea the moment he opens the URL.
I couldn't even manage to do it onclick and have searched everywhere with no result. This is one of the versions I tried:
<!DOCTYPE html>
<html>
<body>
<input type="textarea" id="demotext" value=" " size="40" />
<button onclick="PasteFunction()">Paste text</button>
<script>
function PasteFunction() {
document.getElementById("demotext").innerHTML=window.clipboardData.getData('Text');
}
</script>
</body>
</html>
It is probably better if you know the full description of my end goal and can suggest a smarter alternative:
I want to connect the Excel data from the client to my web application without requiring the user to manually paste the data. My web application is triggered when the clipboard content is manually pasted into my textarea.
An Excel add-in can guide the user to manually copy his data and access an URL to my web application, that part is fine. Once he is there, the data would be automatically pasted and the web application would start. In case there is a much easier solution using the server side, I can consider and I am using Flask, but I would prefer not to bring the user data to the server.