PHP Classes

Validating if there was a signature

Recommend this page to a friend!

      Sign on display  >  All threads  >  Validating if there was a signature  >  (Un) Subscribe thread alerts  
Subject:Validating if there was a signature
Summary:Any way to know if there was a signature ?
Messages:3
Author:whackeroo
Date:2014-06-23 18:49:50
Update:2014-06-25 15:05:22
 

  1. Validating if there was a signature   Reply   Report abuse  
Picture of whackeroo whackeroo - 2014-06-23 18:49:50
First of all: Great Php library!

My hats off to you.

I'm in the process of using this great library of yours in all of my upcoming projects that will require online signature.

But hit a snag along the way.

Are there any way via jQuery or javascript to test if there is an actual signature prior to submission ?

And also via Php, too.


Thanks and have a good day.


Temujin Jumlani


  2. Re: Validating if there was a signature   Reply   Report abuse  
Picture of Gianluca Zanferrari Gianluca Zanferrari - 2014-06-24 07:38:52 - In reply to message 1 from whackeroo
If the folder is writable the class should produce an output below the signature square.

I have a printscreen for you here:

postimg.org/image/fig33z5eh/

gr.

  3. Re: Validating if there was a signature   Reply   Report abuse  
Picture of whackeroo whackeroo - 2014-06-25 15:05:22 - In reply to message 2 from Gianluca Zanferrari
I got this somewhere in the internet and works well:

var d = $('#signature').jSignature("getData", "native");

// if there are more than 2 strokes in the signature
// or if there is just one stroke, but it has more than 20 points
if ( d.length > 2 || ( d.length === 1 && d[0].x.length > 20 ) ){
message.push("A signature is given!");

} else {
errors.push("A signature is required!");

}