thread-pond / signature-pad

A jQuery plugin for assisting in the creation of an HTML5 canvas based signature pad. Records the drawn signature in JSON for later regeneration.
BSD 3-Clause "New" or "Revised" License
730 stars 290 forks source link

Name validation for #type-it only #141

Closed lilad closed 9 years ago

lilad commented 9 years ago

Just learning sigpad and I appreciate your work!

I'm wondering how to:

I played with validateFields = false and tried to do my own verification onFormError function without success...

Thank you for your help, LD

thomasjbradley commented 9 years ago

I think the direction you're going by setting validateFields: false is correct. Then, yeah, you'd have to create your own onFormError callback.

But beyond that, I'm not sure exactly how to proceed. Is there a specific issue that you're running into when trying to create your onFormError callback?

lilad commented 9 years ago

Hi Thomas,

Thank you for your reply.

1/ I'm not sure about the syntax to use to create my own onFormError... I don't find real good example of it. 2/ I was thinking about the following method:

a) validateFields: false b) Create my own onFormError $('.sigPad').signaturePad({ onFormError : function (errors, context, settings) {

c) Type if ($('.type').is(':selected)) {

d) Draw if ($('.draw').is(':selected)) {

If this logic is possible, this would be a solution. I'm not so good on jquery, that's the reason I require your advices,

Thank you, LD

thomasjbradley commented 9 years ago

What you've written above looks okay to me. I don't immediately see anything that wouldn't work.