Skip to content
/ baseline-decimal Public template

A baseline replacement for the default decimal field.

License

Notifications You must be signed in to change notification settings

surveycto/baseline-decimal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Baseline decimal field

Screenshot

Description

A simple replacement for the default decimal field, plus a few improvements (see below). You can either download and use this as-is, or you can use it as a starting template when creating your own field plug-in for a decimal field.

Download now

Features

In addition to supporting the default SurveyCTO features listed below, this field plug-in offers the following expanded functionality:

  1. Support for RTL languages
    If your label or hint is in a language that uses a right-to-left alphabet (like Arabic), it will be right-justified.
  2. Support for HTML in field references
    If you reference another field's value in either the field label or field hint, and that referenced value contains HTML, the HTML will be correctly rendered.

Data format

This field plug-in requires the decimal field type.

How to use

Getting started

To use this plug-in as-is, just download the baseline-decimal.fieldplugin.zip file from this repo, specify this field plug-in as a custom field appearance in the form design (like in the test form), and attach it to your form. For more details about using field plug-ins, please read the user documentation.

To create your own field plug-in using this as a template, follow these steps:

  1. Fork this repo
  2. Make changes to the files in the source directory.
    • Note: be sure to update the manifest.json file as well.
  3. Zip the updated contents of the source directory.
  4. Rename the .zip file to yourpluginname.fieldplugin.zip (replace yourpluginname with the name you want to use for your plug-in).
  5. You may then attach your new .fieldplugin.zip file to your form as normal.

For more information about developing your own field plug-ins, please read the developer documentation.

Default SurveyCTO feature support

Feature / Property Support
Supported field type(s) decimal
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
media:audio Yes
media:video Yes
show-formatted appearance No

Parameters

Note about the keyboard on iOS:
iOS has a less-consistent way of determining which on-screen keyboard to display than Android. If you plan on using this field plug-in on iOS, you should test your form on the actual iOS device that you plan on using. If the wrong keyboard appears (for example, if there is no minus button available), you may supply an optional parameter to the plug-in to set the keyboard type manually.

Parameter key Parameter value
inputmode-ios, inputmode-android, inputmode-web (all optional) Possible values: none, text, decimal, numeric, tel, search, email, url. Click here for more information about the inputmode attribute.

While the inputmode-ios parameter is the most important, you can also use the inputmode-android and inputmode-web parameters to change the keyboard for that field in Android and web forms, respectively.

More resources