Are you still struggling with this? See the code from our "Draw a Robot" app (I'm the creator or RoCanvas):
alert("Please accept the distribution terms!");
var strImageData = canvas.toDataURL();
In order to have things working you need to pass this.form when calling the function. Perhaps it's best to visit my app and use View source to figure out how it works. I can share the PHP code too if that can help.