Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is empty #89

Open
gerabu opened this issue May 11, 2018 · 4 comments
Open

Is empty #89

gerabu opened this issue May 11, 2018 · 4 comments

Comments

@gerabu
Copy link

gerabu commented May 11, 2018

How to know if the signature pad is empty?

@Binternet
Copy link

Try
console.log( $('#signature').jSignature("getData",'native').length > 0 );

Should return true if its signed.

@gerabu
Copy link
Author

gerabu commented May 16, 2018

It is never truly empty because a guideline is always drawn

@Binternet
Copy link

Check the demo:
https://willowsystems.github.io/jSignature/#/demo/

Run the command see it returns false
Then draw and signature and run it again.

@KeithETruesdell
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants