mctextentry
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| mctextentry [2022/09/10 12:02] – admin | mctextentry [2023/10/20 08:12] (current) – [horizPad] admin | ||
|---|---|---|---|
| Line 4: | Line 4: | ||
| * Automatically clears entered text from de-selected choices as needed based on choice exclusivity | * Automatically clears entered text from de-selected choices as needed based on choice exclusivity | ||
| * Focuses on text input fields when associated choice is selected | * Focuses on text input fields when associated choice is selected | ||
| - | * Adds placeholder text | ||
| * Removes white space from beginning and end of entered text | * Removes white space from beginning and end of entered text | ||
| * Sets specified or auto-detected background color | * Sets specified or auto-detected background color | ||
| * Optionally hides text inputs of unselected choices | * Optionally hides text inputs of unselected choices | ||
| * Optionally sets text input heights and widths | * Optionally sets text input heights and widths | ||
| + | * Optionally adds placeholder text | ||
| + | * Optionally adds prefixes or suffixes | ||
| * Works with in-page display logic | * Works with in-page display logic | ||
| Line 17: | Line 18: | ||
| {{ :: | {{ :: | ||
| - | This function is available for a reasonable fee. Contact [[https:// | + | This function is available for a reasonable fee. Contact |
| ===== Set-up Instructions ===== | ===== Set-up Instructions ===== | ||
| ==== Survey Header ==== | ==== Survey Header ==== | ||
| - | To make the function available to all questions in the survey, copy the function to the Survey Header inside a script tag: | ||
| Add the mcTextEntry function to the survey header to make it available to any question in the survey. | Add the mcTextEntry function to the survey header to make it available to any question in the survey. | ||
| < | < | ||
| Line 34: | Line 34: | ||
| </ | </ | ||
| - | To override the default options, specify the desired [[mctextentry# | + | To override the default options, specify the desired |
| < | < | ||
| Qualtrics.SurveyEngine.addOnload(function() { | Qualtrics.SurveyEngine.addOnload(function() { | ||
| Line 42: | Line 42: | ||
| ===== Options ===== | ===== Options ===== | ||
| ==== bgColor ==== | ==== bgColor ==== | ||
| - | **bgColor** specifies the background color of the text entry boxes. If empty ("" | + | **bgColor** specifies the background color of the text entry boxes. If empty (%%"" |
| - | Default: "" | + | Default: |
| ==== breakBeforeText ==== | ==== breakBeforeText ==== | ||
| **breakBeforeText** specifies if the text entry boxes should be below (true) or on the same line (false) as the choice label text. The global break can be overridden for individual choices by adding the following html to the choice label text:\\ | **breakBeforeText** specifies if the text entry boxes should be below (true) or on the same line (false) as the choice label text. The global break can be overridden for individual choices by adding the following html to the choice label text:\\ | ||
| < | < | ||
| - | <span data-inputbreak=" | + | <span data-textbreak=" |
| </ | </ | ||
| Line 57: | Line 57: | ||
| Default: false | Default: false | ||
| ==== horizPad ==== | ==== horizPad ==== | ||
| - | **horizPad** is used to reduce the amount of label/text box left/right padding from the default for multiple choice questions in a horizontal position. Leave empty "" | + | **horizPad** is used to reduce the amount of label/text box left/right padding from the default for multiple choice questions in a horizontal position. Leave empty %%("" |
| - | Default: 5px | + | Default: |
| ==== multiColPad ==== | ==== multiColPad ==== | ||
| - | **multiColPad** is used to reduce the amount of label/text box left/right padding from the default for multiple choice questions with columns. Leave empty "" | + | **multiColPad** is used to reduce the amount of label/text box left/right padding from the default for multiple choice questions with columns. Leave empty (%%"" |
| - | Default: 5px | + | Default: |
| ==== placeholder ==== | ==== placeholder ==== | ||
| - | **placeholder** sets a global placeholder for all text entry boxes in the question. Set to empty ("" | + | **placeholder** sets a global placeholder for all text entry boxes in the question. Set to empty (%%"" |
| < | < | ||
| - | <span data-inputph=" | + | <span data-textph=" |
| </ | </ | ||
| - | Default: "" | + | Default: |
| + | ==== prefix ==== | ||
| + | **prefix** sets a global prefix text for all text entry boxes in the question. Set to empty (%%"" | ||
| + | < | ||
| + | <span data-textprefix=" | ||
| + | </ | ||
| + | |||
| + | Default: %%"" | ||
| ==== reqText ==== | ==== reqText ==== | ||
| **reqText** automatically de-select multi-select choices if the text entry box is empty. | **reqText** automatically de-select multi-select choices if the text entry box is empty. | ||
| Default: true | Default: true | ||
| + | ==== suffix ==== | ||
| + | **suffix** sets a global suffix text for all text entry boxes in the question. Set to empty (%%"" | ||
| + | < | ||
| + | <span data-textsuffix=" | ||
| + | </ | ||
| + | |||
| + | Default: %%"" | ||
| ==== textHeight ==== | ==== textHeight ==== | ||
| - | **textHeight** specifies the global height of the text entry boxes. Empty ("" | + | **textHeight** specifies the global height of the text entry boxes. Empty (%%"" |
| < | < | ||
| - | <span data-inputhgt=" | + | <span data-texthgt=" |
| </ | </ | ||
| - | Default: "" | + | Default: |
| ==== textWidth ==== | ==== textWidth ==== | ||
| **textWidth** specifies the global width of the text entry boxes. The global width can be overridden for individual choices by adding the following html to the choice label text:\\ | **textWidth** specifies the global width of the text entry boxes. The global width can be overridden for individual choices by adding the following html to the choice label text:\\ | ||
| < | < | ||
| - | <span data-inputwidth=" | + | <span data-textwidth=" |
| </ | </ | ||
| - | Default: " | + | Default: |
| //Note on mobile phones (screen width <= 480px)//: Qualtrics includes a css media rule " | //Note on mobile phones (screen width <= 480px)//: Qualtrics includes a css media rule " | ||
mctextentry.1662825750.txt.gz · Last modified: by admin
