top of page
Signature Input

Signature Input

Create a custom form that includes a Signature Input element

Intermediate.png

Intermediate

4K

Published:

July 8, 2020

Girl Enjoying her Drink

by

Anchor 1
Hire a Developer

Example Description

In this example we created a custom health declaration form that includes a signature input element. The form submission process is handled with code, and not by connecting to a database collection via a dataset. We use code to manually perform input validations, submit the form data into a database collection, display a success message, and clear the form fields.

Example Code

Tab 1

.

Tab 2

.

Tab 3

.

This code solution can be complicated.

How We Built It

Collection

 

We added a Health Declaration database collection to our site to store the form data.

 

Page Elements

 

In our site we added the following elements:

  • 3 text input elements for entering personal information

  • Signature input element for signing the form

  • Submit button

  • Success and error message text elements

 

Code

 

When a site visitor fills in the form and clicks the submit button, the following occurs:

  1. Validity check: If any required fields are empty, display a message requesting that the visitor fill in the missing fields.

  2. Insert data: If validations pass, insert the form data into the Health Declarations collection and display a success message. An image of the signature is stored directly in the collection using a data URL.

  3. Clear fields: Following a successful data insertion, clear the signature input and clear the text inputs by setting their value to null. To prevent the validity indicators (such as a red border) from displaying in the now-empty inputs, reset the validity indications.

 

We also added event handlers for hiding the success and error messages following an error or a submit. The event handlers are connected to the Properties panel and run when a visitor types inside a text input or draws a signature. Note that all 3 text inputs are connected to the same event handler.

Hire a Developer

Velo solutions are powerful tools, but building them on your own can be challenging. Let an experienced Velo development shop build it for you, so you can keep working on your site or business.

Related Examples

Did this help?

Yes

|

No

Thanks for your feedback!

Collapsing Form

Collapsing Form

Collapse and expand sections of a form.

Intermediate.png

Beginner

Multistage Form

Multistage Form

Create a form split into multiple steps.

Intermediate.png

Beginner

Cascading Form

Cascading Form

Change the options of a dropdown based on a previous selection.

Intermediate.png

Intermediate

Basic Form

Basic Form

Create a basic form without writing a line of code.

Intermediate.png

Beginner

Anchor 2
bottom of page