I need help with jSignature. I am able to create an image and then write that image back into the page. What I can't get working (and the reason I was exploring this plugin in the first place) is the exporting of the image out of the page. I want to take the image data and send it out in an email so that the image shows up in the body of the email. If have tried a lot of approaches and nothing has worked. Currently my js looks like this:
var $sigDiv = $("#signature").jSignature();
$('<input type="button" value="Reset">').bind('click', function(e){
$sigDiv.jSignature('reset');
}).appendTo($sigDiv);
And upon submit of the form it looks like this:
var datapair = $sigDiv.jSignature("getData", "svg");
var i = new Image();
i.src = "data:" + datapair[0] + "," + datapair[1];
$(i).appendTo($("#success"));
I try to grab that image data in a variable and through AJAX send it in a data string to a PHP mail processing form doing something like this:
<img src="<?php echo $_POST['signature']; ?>"/>
Or this:
<object src="<?php echo $_POST['signature']; ?>"></object>
I've exhausted myself on trying to get this to display an image in the email that goes out. Any help is much appreciated.