This script enables you to add symbols or text before or after the text fields in Numeric or Open End questions.
Note:
- This script works only on desktop with Open End and Numeric Open End questions. It does not work on mobile or with Numeric Sliders.
- This script works only if participants have Javascript enabled on their browsers.
Example
Add a dollar sign or percentage symbol adjacent to the text field to clearly communicate the type of information you would like your participants to provide.
Detailed Steps
- Copy the script below into Notepad or any other text editor (e.g. Notepad++, Textpad).
- Change QuestionName to the name of your text question.
- Change Symbol to the symbol you want to add. e.g. "$", "%", or "Minutes"
- Change false to true only if you want to add the symbol left to the text box. Otherwise, leave it as is.
- If you require the same script multiple times on a page, duplicate the very last line of the code and repeat step 2 to 4.
- Insert the completed script into the Script section of the question or page that the question is on by doing the following:
- Select the Date question in the Questionnaire Tree.
- In the Scripting section of the page, click Edit Scripts.
- Paste the script into the JavaScript tab.
- Click Save.
- Click Save.
- Validate and test your survey.
Script
<script src="https://static.visioncritical.net/prog/ext_libs/jquery/jquery-1.12.3.min.js" type="text/javascript"></script> <SCRIPT src="https://static.visioncritical.net/prog/s1/js/common/common_v1.561.js"> /* Script Name: How do I add symbols or text before or after a text box? To ensure your script works as expected, always copy the original script from the script library found in the support portal. Failure to use the most up to date script from the script library may cause unexpected results. */</SCRIPT> <SCRIPT>appendSymbol_Verbatim([%(QuestionName.Id)%], "Symbol", false);</SCRIPT>
More Information
Read this Knowledge Base article to learn more about How do I add symbols or text before or after Allocation Grid text boxes?.
Comments
0 comments
Article is closed for comments.