Signature Field in forms

Would if be possible to have a form field that accepts the input of someone writing their signature or initials graphically in a form field.
This would then create a png and upload as part of form submission.

Would anyone else have use for this?

1 Like

Hi @ReaganVautier
I have done something similar for a client of ours. I have done it with a png/base64. So basically there is a signature field as the one you have shown, and the signature will then be stored in a text field as base64 code. So in the module you will just have the code which can then be converted back into a “normal” png if you would like.

This code can be shown in a normal img tag like this for example:

<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==" alt="Red dot" />

Red dot

The above red dot is that img tag.

I am aware that it won’t show up as an image in the backend, so maybe this is not possible for you.

In the case where we use it, we have made a “backend” on the frontend for the client, so we can relatively easily show the signature as an image :slight_smile:

– Let me know if you want further details on this, I remember it as being easier than I thought :slight_smile:

Thanks Peter,
Based on your comment I’ve dug a little deeper and figured out how to do this, and yes, it’s surprisingly much easier than expected.

No worries @ReaganVautier.
This was the codepen demo I used for building it.

When a signature is made, the signature “capture” field will update with the base64 value, and this value I just put in a custom module item called “Signature” for example.

And when you need to show the signature you just publish the value to an img tag as shown above :slight_smile: