Keep Metric and Imperial Height Fields Synced in a Form
This JavaScript snippet links two JetFormBuilder range fields for height, syncing values between centimeters and inches. Adjusting one field automatically updates the other, allowing users to enter height in either unit without manual conversion.
Specifications
Keep Metric and Imperial Height Fields Synced in a Form
6 January, 2026
-
Plugin
-
Category
-
Programming languages
Installing Instruction
- Copy the provided JavaScript code snippet to your clipboard.
- Add the code using one of the following methods:
-
Option A: Using a Custom Code Plugin (Recommended)
- Install and activate a plugin such as WPCode Lite, Code Snippets, or Simple Custom CSS and JS.
- Create a new JavaScript snippet.
- Paste only the JavaScript code, without <script> tags.
- Save and activate the snippet.
-
Option B: Using a Custom Code / HTML Area
- Add the code in a Custom HTML widget or directly into a theme file (for example, header.php or footer.php).
- Keep the <script> tags when using this method.
- Save your changes.
-
Option A: Using a Custom Code Plugin (Recommended)
Example Use Case
Use this snippet to link two related range fields in JetFormBuilder forms, such as metric and imperial height, syncing values automatically.
Applicable scenarios:
- Health or fitness websites: Let users enter measurements in their preferred units.
- Survey or registration forms: Help users input data consistently across different measurement systems.
- Any form requiring dual-unit inputs: Prevent input errors and improve UX.
Specifications
Keep Metric and Imperial Height Fields Synced in a Form
6 January, 2026
-
Plugin
-
Category
-
Programming languages