Skip to content

An image map type appearance in which you can click on an image region as a response.

License

Notifications You must be signed in to change notification settings

surveycto/clickable-svg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Clickable SVG

Screenshot

Description

This field plug-in allows you to click on a part of an image and record which part was clicked. Clicking on a named region (either a path or a group of paths with an ID) in an .svg image will select that region, and fill in the text field with the ID of the region. To help indicate which region is currently selected, all regions will start out at 40% opacity. When selected, a region will return to 100% opacity.

Download now

Data format

This field plug-in requires the text field type.

Whenever you click on a region, the text input box will be updated with the ID of the selected region.

How to use

Getting started

  1. Create a text field.
  2. Attach an .svg image to that text field (using the media:image field property).
  3. Attach this plug-in to the text field.
  4. When you fill out the form and click on a path in the .svg image, the ID value of that path will be entered into the text field and stored as the response data.

Default SurveyCTO feature support

Feature / Property Support
Supported field type(s) text
Default values Yes
Constraint message Uses default behavior
Required message Uses default behavior
Read only Yes (shows the current value, if present)
media:image Yes (required)
media:audio Yes
media:video Yes
numbers appearance No
numbers-decimal appearance No
numbers-phone appearance No

Note: since the ID values from within the .svg image will be used to update the field response, it is recommended that you make sure they are named appropriately. Each clickable region should have a unique ID. Check out the test-form and the two associated .svg files to see examples. See below for links to some other resources which might help you.

More resources