Question T14630
Visible to All Users

Signature Block

created a year ago

Hello!

I'm wondering if there is a way to put in requirements for the signature block to enforce a more complete signature. I have been getting submissions with just a few dots (see below).

Clipboard-File-1.png

Any advice?

Thanks!

Answers approved by surveyjs Support

created a year ago

Hello,

You could use onAfterRenderQuestion event to store the canvas element in your application -

Code
signatureCanvas = options.htmlElement.getElementsByTagName("canvas")[0]

https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#onAfterRenderQuestion

Then you need to use custom validation with onValidateQuestion event
https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#onValidateQuestion

and process the signature in your own way with some pixel manipulation with canvas https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Tutorial/Pixel_manipulation_with_canvas

Thank you,
Alex
SurveyJS Team