Toggle menu
862
3.8K
30.2K
279.1K
Catglobe Wiki
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Maximum text length: Difference between revisions

From Catglobe Wiki
New page: == Challenge == You want to set maximum length on text question == Code == quest.maxlength = 2
 
Cg van (talk | contribs)
No edit summary
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== Challenge ==  
== Maximum text length  ==
You want to set maximum length on text question
 
== Code ==  
In order to limit number of characters that respondent input to text box.
quest.maxlength = 2
 
As a questionnaire creator
 
I want to set maximum length on text question.
 
'''Example'''
 
*I have a Text grid question like below.
 
[[Image:MaximumTextLength1.jpg]]
 
*I want to set maximum length on text question.
 
[[Image:MaximumTextLength2.jpg]]
 
=== Solution  ===
 
*Add a Text grid question to Questionnaire editor like below
*Go to menu Properties -> Question scripts -> Java script tab -> Input script
 
[[Image:MaximumTextLength Code.jpg]]
 
=== Code  ===
 
<source lang="javascript">
quest.maxlength = 10;
</source>
 
=== Source  ===
 
Questionnaire Resource Id on cg site: 159730

Latest revision as of 10:22, 16 January 2012

Maximum text length

In order to limit number of characters that respondent input to text box.

As a questionnaire creator

I want to set maximum length on text question.

Example

  • I have a Text grid question like below.

  • I want to set maximum length on text question.

Solution

  • Add a Text grid question to Questionnaire editor like below
  • Go to menu Properties -> Question scripts -> Java script tab -> Input script

Code

quest.maxlength = 10;

Source

Questionnaire Resource Id on cg site: 159730