Home > Forum > Forms > SOLVED -> Q: Is it possible to change the pencil color in "HANDWRITTEN SIGNATURE" FORM FIELD

SOLVED -> Q: Is it possible to change the pencil color in "HANDWRITTEN SIGNATURE" FORM FIELD
0

MVP

Good morning everybody,

did anyone of you managed to change the pencil color of the "HANDWRITTEN SIGNATURE" FORM FIELD ?

Thanx and a nice, sunny weekend (not here ;-) ),
Bjoern

MVP

Hi Björn

Based on https://codepen.io/zsolt555/pen/rpPXOB I managed to change the color of the handwritten signature field.

Add the following script into a html field (don't forget the script tags...):
var signature = document.querySelector('.editable-canvas__canvas');
var context = signature.getContext('2d');

function setInitialColor() {
context.strokeStyle = 'red';
}

signature.addEventListener( 'mousemove', setInitialColor );

MVP
In reply to: Markus Jenni

Hi Björn

Based on https://codepen.io/zsolt555/pen/rpPXOB I managed to change the color of the handwritten signature field.

Add the following script into a html field (don't forget the script tags...):
var signature = document.querySelector('.editable-canvas__canvas');
var context = signature.getContext('2d');

function setInitialColor() {
context.strokeStyle = 'red';
}

signature.addEventListener( 'mousemove', setInitialColor );

Perfect Markus - wow that was fast,

i made the "SUGGESTION: MIX BETWEEN "PICTURE" AND "HANDWRITTEN SIGNATURE" FORM FIELD":
https://community.webcon.com/forum/thread/2230?page=1#m2231

But as a work-around i would like to use a "Handwritten signature" form field and insert into that the contents of a picture form field (works!).

I now can use the signature pencil to mark something - thanks to you in an other color than black (i will try at the weekend).

Of course there are still problems with the zoom or the automatic adjustment of the image width to be solved, but one thing at a time.



We'll see each other again on WEBCON DAY at the latest,
Bjoern

P.S.: First part works already - Merci