Open gerabu opened 6 years ago
Try
console.log( $('#signature').jSignature("getData",'native').length > 0 );
Should return true if its signed.
It is never truly empty because a guideline is always drawn
Check the demo: https://willowsystems.github.io/jSignature/#/demo/
Run the command see it returns false
Then draw and signature and run it again.
I had the same issues, and it never returned false when there was a signature line. This 'issue' had been resolved from the original repo from brinley a couple years ago. This repo is about 6 years old. By changing over to the brinley repo and then doing something like....
if ((typeof jsSigData != 'undefined') && $("##js-signature").jSignature("isModified")) {
jsSigDataValid = true;
}
you will make sure that there someone singed things.
This also works with the signature line, and in the situation that there is a clear button. If someone signs, then clears, it will return "false" as in nothing is modified. The method above will return true, regardless.
So go with the brinley one.
How to know if the signature pad is empty?