Making a Signature Form (with CraftForms WP)

Ivan
Ivan
 · 
276 words
 · 
1 minute
reading time

The reason for this post is the following question posted in the CraftForms WP Facebook group:

i have an existing wordpress project that needs updating and i need a signature field for that. Nothing fancy, just a field where the client can sign so that it is embedded in the sent pdf. it’s needed by my client’s insurance company.

is there any plan for a signature field soon?

The plugin author quickly responded he would look into it. In the meanwhile, I set forth to figure out if I could repurpose the existing file upload block that ships with CraftForms WP to capture a signature collected with a 3rd party JS signpad library. Well, I succeeded.

At the time of writing, CraftForms WP is available as a lifetime deal for unlimited websites at a great price (€129.99 ex-VAT). Even if you have a “traditional” form plugin for WordPress, go check this one out. It is worth it. No affiliate link, just good old show of support for a good product that is bound to get even better.
CraftForms WP Lifetime Access

This form requires inclusion of some 3rd party JS to transmogrify the file upload field into a signature field. These will be documented separately but for the more curious, they are visible in the page HTML.

Hint: look for the signature_pad.umd.min.js library in the page header and an IIFE block in the page footer.

The solution makes a sleight of hand: we use the native CraftForm WP file upload field to store the signature generated with the signature pad library, but the drag & drop area, file size limit hint and file list are hidden with CSS.
This tutorial uses the following code snippet(s):

This website uses cookies to enhance your browsing experience and ensure the site functions properly. By continuing to use this site, you acknowledge and accept our use of cookies.

Accept All Accept Required Only