---
title: "Javascript"
url: "https://docs.leaddoubler.com/en/article/javascript"
language: "en"
last_updated: "2024-08-30T05:55:25.774Z"
---

# Javascript

Javascript documentation for the Modern 2.0 template

## Overview

* * *

The Modern 2.0 template now contains a list of variables that you can make changes to update look and behaviour of Modern 2.0.

You can see the list of options you can chance and their default value in the following list:

### Basic options

Enlarges the table by opening it in a full screen dialogOpen

| #### Modern checkbox |
| --- |
| **Description:**   <br>Modern and animated checkbox |
| **Value:**   <br>`true` or `false` |
| **Default value:**   <br>`true` |
| **Full code:**<br>```javascript<br>var checkBoxModernFixOption = true;<br>``` |

| #### Flex buttons |
| --- |
| **Description:**   <br>Make buttons inside the form always use the full width of the page, even when in 2 rows |
| **Value:**   <br>`true` or `false` |
| **Default value:**   <br>`false` |
| **Full code:**<br>```javascript<br>var flexButtonsOption = false;<br>``` |

| #### Hide headings |
| --- |
| **Description:**   <br>Hides the input type “heading” from the form, usefull in quiz format |
| **Value:**   <br>`true` or `false` |
| **Default value:**   <br>`true` |
| **Full code:**<br>```javascript<br>var hideFormHeadingsOption = true;<br>``` |

| #### Show Quiz Steps |
| --- |
| **Description:**   <br>Show the current page and total pages when in quiz mode |
| **Value:**   <br>`true` or `false` |
| **Default value:**   <br>`false` |
| **Full code:**<br>```javascript<br>var showQuizStepsOption = false;<br>``` |

| #### Hide the back button |
| --- |
| **Description:**   <br>Hides the back button when in quiz mode |
| **Value:**   <br>`true` or `false` |
| **Default value:**   <br>`true` |
| **Full code:**<br>```javascript<br>var hideQuizBackButtonOption = true;<br>``` |

| #### Modern radio buttons |
| --- |
| **Description:**   <br>Modern and animated radio buttons |
| **Value:**   <br>`true` or `false` |
| **Default value:**   <br>`true` |
| **Full code:**<br>```javascript<br>var modernInlineRadioOption = true;<br>``` |

| #### Modern radio images |
| --- |
| **Description:**   <br>Modern and radio image buttons |
| **Value:**   <br>`true` or `false` |
| **Default value:**   <br>`true` |
| **Full code:**<br>```javascript<br>var modernRadioImagesOption = true;<br>``` |

| #### Modern quantity: |
| --- |
| **Description:**   <br>Modern and updated quantity input fields |
| **Value:**   <br>`true` or `false` |
| **Default value:**   <br>`true` |
| **Full code:**<br>```javascript<br>var modernQuantityOption = true;<br>``` |

| #### Modern quantity images |
| --- |
| **Description:**   <br>Modern and updated quantity image fields |
| **Value:**   <br>`true` or `false` |
| **Default value:**   <br>`true` |
| **Full code:**<br>```javascript<br>var modernQuantityImageOption = true;<br>``` |

### Date picker options

| #### Modern datepicker |
| --- |
| **Description:**   <br>Enables the modern datepicker, all other datepicker options requires this to be `true` to work |
| **Value:**   <br>`true` or `false` |
| **Default value:**   <br>`true` |
| **Full code:**<br>```javascript<br>var datePickerModernFixEnabledOption = true;<br>``` |

| #### Date picker language |
| --- |
| **Description:**   <br>Changes to language from english. Only Danish and English is supported for now |
| **Value:**   <br>use `"dk"` for Danish or leave empty for English |
| **Default value:**   <br>`""` |
| **Full code:**<br>```javascript<br>var datePickerModernFixLanguageOption = ""; // "dk" for Danish, else English<br>``` |

| #### Month selector |
| --- |
| **Description:**   <br>Adds a dropdown menu to change month |
| **Value:**   <br>`true` or `false` |
| **Default value:**   <br>`false` |
| **Full code:**<br>```javascript<br>var datePickerChangeMonthOption = false;<br>``` |

| #### Year selector |
| --- |
| **Description:**   <br>Adds a dropdown to select year |
| **Value:**   <br>`true` or `false` |
| **Default value:**   <br>`false` |
| **Full code:**<br>```javascript<br>var datePickerChangeYearOption = false;<br>``` |

| #### Year range |
| --- |
| **Description:**   <br>Limit the datepicker to a range of years |
| **Value:**   <br>`Range example: "2020:2025"` |
| **Default value:**   <br>`""` |
| **Full code:**<br>```javascript<br>var datePickerYearRangeOption = ""; //Range example: "2020:2025"<br>``` |

### Input fields with legend options

| **Modern Input Label Legends** |
| --- |
| **Description:**   <br>Uses the label as both placeholder and title of an input field |
| **Value:**   <br>`true` or `false` |
| **Default value:**   <br>`true` |
| **Full code:**<br>```javascript<br>var modernInputLabelLegendsEnabledOption = true;<br>``` |

| **Legend Background** |
| --- |
| **Description:**   <br>Adds a colored background to the legend, |
| **Value:**   <br>`true` or `false` |
| **Default value:**   <br>`false` |
| **Full code:**<br>```javascript<br>var modernInputLabelLegendsDarkBgOption = false;<br>``` |

### Quantity group options

| **Group Quantities** |
| --- |
| **Description:**   <br>Groups all Quantities that are next to eachother. Quantity Group options requires this to be `true` to work |
| **Value:**   <br>`true` or `false` |
| **Default value:**   <br>`true` |
| **Full code:**<br>```javascript<br>var modernQuantityGroupEnabledOption = true;<br>``` |

| **Group Align Center** |
| --- |
| **Description:**   <br>Centers the Quantitity group elements |
| **Value:**   <br>`true` or `false` |
| **Default value:**   <br>`true` |
| **Full code:**<br>```javascript<br>var modernQuantityGroupedAlignCenterUngroupedOption = true; //Only works if quantity are grouped<br>``` |

### File upload options

| **Modern File Upload** |
| --- |
| **Description:**   <br>Enable Modern Fileupload with Drag and Drop functionalities |
| **Value:**   <br>`true` or `false` |
| **Default value:**   <br>`true` |
| **Full code:**<br>```plaintext<br>var modernFileUploadEnabledOption = true;<br>``` |

| **Modern File Upload Language** |
| --- |
| **Description:**   <br>Changes to language from english. Only Danish and English is supported for now |
| **Value:**   <br>use `"dk"` for Danish or leave empty for English |
| **Default value:**   <br>`""` |
| **Full code:**<br>```plaintext<br>var modernFileUploadLanguageOption = ""; // "dk" for Danish, else English<br>``` |

## Change an option

* * *

If you want to change one of the options you simply copy the whole line of the option, go into your calculator, click on “Insert custom HTML” in the menu to the right:

![](https://cdn-assets.productfruits.com/6c1a452d-d281-45a5-8c2a-56f6ab6364e9)

After that, click on “Analytics Code” in the popup box:

![](https://cdn-assets.productfruits.com/504a5712-871f-4c31-abf8-4f858fcdd371)

Find the following area:

![](https://cdn-assets.productfruits.com/25bc00aa-256d-4c64-97fe-82c2c204bb64)

And simply add your copied option and update it to reflect the change you wish to make and press the “Save” button:

![](https://cdn-assets.productfruits.com/685f6b0e-47ef-4724-9a9f-4cd9178b6b90)
