madlibs
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| madlibs [2022/09/30 13:00] – [qMadLib - Fill-in-the-blank, MadLib, or Cloze type questions] admin | madlibs [2025/01/29 20:16] (current) – [Input Attributes] admin | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== qMadLib - Fill-in-the-blank, | ====== qMadLib - Fill-in-the-blank, | ||
| This function converts a Qualtrics Side-by-Side question or a series of Text Entry and Drop-down questions into a fill-in-the-blank style question. The ' | This function converts a Qualtrics Side-by-Side question or a series of Text Entry and Drop-down questions into a fill-in-the-blank style question. The ' | ||
| - | {{::madlib_example.png?600|}} | + | {{::qmadlib.mp4?695|}} |
| The qMadlib function does contact forms too!\\ | The qMadlib function does contact forms too!\\ | ||
| Line 34: | Line 34: | ||
| * **[[madlibs# | * **[[madlibs# | ||
| - | This function is available for a reasonable fee. Contact **[[https:// | + | This function is available for a reasonable fee. Contact **[[https:// |
| ===== Set-up Instructions ===== | ===== Set-up Instructions ===== | ||
| Line 77: | Line 77: | ||
| ==== Series of Questions ==== | ==== Series of Questions ==== | ||
| - | As an alternative to a Side-by-side question, a series of separate questions may be used. The first question must be a Descriptive | + | As an alternative to a Side-by-side question, a series of separate questions may be used. The first question must be a Text/ |
| - | After the descriptive text question with fill-in elements, add text entry and/or multiple choice dropdown questions to match. There must be the __same number__ of text entry and/or multiple choice dropdown questions as there are fill-in-the-blanks in the Madlib. The questions __must__ be in the __same order__ as the fill-in-the-blank inputs (text inputs and drop downs). | + | After the Text/ |
| === Drop Down === | === Drop Down === | ||
| Line 88: | Line 88: | ||
| ==== JavaScript Function Call ==== | ==== JavaScript Function Call ==== | ||
| - | Add JS to either the Side-by-Side question or the Descriptive | + | Add JS to either the Side-by-Side question or the Text/ |
| < | < | ||
| Qualtrics.SurveyEngine.addOnReady(function() { | Qualtrics.SurveyEngine.addOnReady(function() { | ||
| Line 118: | Line 118: | ||
| === Style === | === Style === | ||
| - | To hide the question from the respondent while it is being formatted by JS, add a < | + | To hide the question from the respondent while it is being formatted by JS, add an embedded data field to the beginning of the survey flow: |
| - | < | + | < |
| + | opacity0 = opacity: | ||
| + | </ | ||
| + | Then add a < | ||
| + | < | ||
| + | </ | ||
| + | An embedded data field is used so opacity style does not impact survey editing. Add the following to a question later in the survey so that 'View response' | ||
| + | < | ||
| </ | </ | ||
| Line 142: | Line 149: | ||
| === class === | === class === | ||
| - | The following **class** names can be used to format or configure a MadLib input. class=" | + | The following **class** names can be used to format or configure a MadLib input. class=%%" |
| == cleaveRaw == | == cleaveRaw == | ||
| - | The **cleaveRaw** class only applies to a cleave field with numeric formatting. When cleaveRaw is included, the raw value instead of the formatted value of the input is saved in Qualtrics. | + | The **cleaveRaw** class only applies to a cleave field with numeric formatting. When cleaveRaw is included, the raw value instead of the formatted value of the input is saved in Qualtrics. Applies to input elements only. |
| == decimal == | == decimal == | ||
| - | The **decimal** class applies an input mask to an open end Madlib input so only valid decimal values may be entered. **decimal** is ignored if cleave or flatpickr is used. | + | The **decimal** class applies an input mask to an open end Madlib input so only valid decimal values may be entered. **decimal** is ignored if cleave or flatpickr is used. Applies to input elements only. |
| == fillin == | == fillin == | ||
| The **fillin** class is __required__ for all MadLibs input or select elements. | The **fillin** class is __required__ for all MadLibs input or select elements. | ||
| == integer == | == integer == | ||
| - | The **integer** class applies an input mask to an open end Madlib input so only valid integer values may be entered. **integer** is ignored if cleave or flatpickr is used. | + | The **integer** class applies an input mask to an open end Madlib input so only valid integer values may be entered. **integer** is ignored if cleave or flatpickr is used. Applies to input elements only. |
| == lower == | == lower == | ||
| - | The **lower** class applies an input mask to an open end Madlib input so all letters are converted to lowercase. **lower** is ignored if cleave or flatpickr is used. | + | The **lower** class applies an input mask to an open end Madlib input so all letters are converted to lowercase. **lower** is ignored if cleave or flatpickr is used. Applies to input elements only. |
| == nospinner == | == nospinner == | ||
| - | The **nospinner** class hides the up/down arrows (spinner) associated with type=" | + | The **nospinner** class hides the up/down arrows (spinner) associated with %%type=" |
| == proper == | == proper == | ||
| - | The **proper** class applies an input mask to an open end Madlib input so the first letter of each word is capitalized. **proper** is ignored if cleave or flatpickr is used. | + | The **proper** class applies an input mask to an open end Madlib input so the first letter of each word is capitalized. **proper** is ignored if cleave or flatpickr is used. Applies to input elements only. |
| + | == s2off == | ||
| + | The **s2off** class disables select2 on select elements. Use of the s2off class does not support the placeholder attribute. Applies to select elements only. | ||
| == upper == | == upper == | ||
| - | The **upper** class applies an input mask to an open end Madlib input so all letters are converted to uppercase. **upper** is ignored if cleave or flatpickr is used. | + | The **upper** class applies an input mask to an open end Madlib input so all letters are converted to uppercase. **upper** is ignored if cleave or flatpickr is used. Applies to input elements only. |
| == wholenum == | == wholenum == | ||
| - | The **wholenum** class applies an input mask to an open end Madlib input so only valid whole number values may be entered. **wholenum** is ignored if cleave or flatpickr is used. | + | The **wholenum** class applies an input mask to an open end Madlib input so only valid whole number values may be entered. **wholenum** is ignored if cleave or flatpickr is used. Applies to input elements only. |
| === data-cleave === | === data-cleave === | ||
| - | The **data-cleave** attribute specifies that cleave should be used for input masking. The value is a json string that specifies the [[https:// | + | The **data-cleave** attribute specifies that cleave should be used for input masking. It applies to input elements only. The value is a json string that specifies the [[https:// |
| < | < | ||
| data-cleave=' | data-cleave=' | ||
| Line 169: | Line 178: | ||
| === data-flatpickr === | === data-flatpickr === | ||
| - | The **data-flatpickr** attribute specifies that flatpickr should be used to pick a date and/or time. The value is a json string that specifies the [[https:// | + | The **data-flatpickr** attribute specifies that flatpickr should be used to pick a date and/or time. It applies to input elements only. The value is a json string that specifies the [[https:// |
| < | < | ||
| data-flatpickr=' | data-flatpickr=' | ||
| Line 175: | Line 184: | ||
| === inputmode === | === inputmode === | ||
| - | The **inputmode** attribute can be used to specify the type of on-screen keyboard that is shown when a MadLib text input gains focus. For example, inputmode=" | + | The **inputmode** attribute can be used to specify the type of on-screen keyboard that is shown when a MadLib text input gains focus. For example, inputmode=%%" |
| === maxlength === | === maxlength === | ||
| - | The **maxlength** attribute can be used to specify the maximum number of characters for an input field. | + | The **maxlength** attribute can be used to specify the maximum number of characters for an input field. Applies to input elements only. |
| === placeholder === | === placeholder === | ||
| - | The **placeholder** attribute is optional, but important. It contains instructional text that is shown in a MadLib input with a empty value. The length of the text determines the initial size of the input field. | + | The **placeholder** attribute is optional, but important. It contains instructional text that is shown in a MadLib input with a empty value. The length of the text determines the initial size of the input field. Does not apply to select elements with the class **[[madlibs# |
| === type === | === type === | ||
| The **type** attribute is __required__ for input elements. It's value should be **text** or **number**. Browser support for other type values is spotty and they don't provide any value beyond the MadLib configuration options provided. Therefore, they are not recommended. | The **type** attribute is __required__ for input elements. It's value should be **text** or **number**. Browser support for other type values is spotty and they don't provide any value beyond the MadLib configuration options provided. Therefore, they are not recommended. | ||
| == text == | == text == | ||
| - | **type=" | + | **type=%%" |
| == number == | == number == | ||
| - | **type=" | + | **type=%%" |
| ==== Word Completion ==== | ==== Word Completion ==== | ||
madlibs.1664557215.txt.gz · Last modified: by admin
