I have an HTML button that captures the canvas image using toDataURL(). I want to pass the data to a form element, which will send via formmail. I can get all other variables passed via hidden form elements, but the canvas data won't take. It must not be formatted properly to send. What is the correct syntax to send, if possible?
In JavaScript
imgData = theCanvas.toDataURL();
document.getElementById('theImageData').value=imgData;
In HTML
<input type="hidden" name="theImageData" id="theImageData" value="">