For other users who need a push in the right direction, and found that $ _POST or $ _REQUEST is extremely vague ...
Here is what I did.
At first I added hidden input because I included it in the form:
<input type="hidden" name="input_name" value="" />
Then you can save the uri image of the data into this input value, and it will be saved in the form.
I added this in JS to add uri data to the form:
var input = wrapper.querySelector("input"); canvas.addEventListener("mouseup", function(event) { if ( signaturePad.isEmpty() ) { input.value = ''; } else { input.value = signaturePad.toDataURL(); } });
And then update the cleanup button with input.value = ''; to erase the field:
clearButton.addEventListener("click", function (event) { signaturePad.clear(); input.value = ''; });
This is based on the Szimek demo code .
Another option for sending data to your php would be to use an ajax request, which is pretty simple using jQuery $ .ajax or $ .post.
This script is surprisingly easy to use ...
source share