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.

Disable sub questions in text grids: Difference between revisions

From Catglobe Wiki
No edit summary
Cg van (talk | contribs)
No edit summary
Line 1: Line 1:
-Challenge
== Disable Sub questions in Text grid  ==
You want to show the content of a text sub question, but prevent the respondent from editing it.  
 
-Code :
You want to show the content of a text sub question, but prevent the respondent from editing it.  
 
== Code ==
 
<source lang="javascript">
quest.init = function() {


quest.init = function()
{
   //Set those sub question will be disabled
   //Set those sub question will be disabled
  document["query"][this.questions[0].label].disabled = true;
document["query"][this.questions[0].label].disabled = true;
  document["query"][this.questions[1].label].disabled = true;
document["query"][this.questions[1].label].disabled = true;
  document["query"][this.questions[2].label].disabled = true;
document["query"][this.questions[2].label].disabled = true;
  //defines where editing focus should be when the question is opened. You have to define this if you choose to make the sub question with index 0 uneditable.
//defines where editing focus should be when the question is opened. You have to define this if you choose to make the sub question with index 0 uneditable.
  document["query"][this.questions[3].label].focus();
document["query"][this.questions[3].label].focus();
 
}
}
</source>

Revision as of 09:30, 10 January 2012

Disable Sub questions in Text grid

You want to show the content of a text sub question, but prevent the respondent from editing it.

Code

quest.init = function() { 

   //Set those sub question will be disabled
 document["query"][this.questions[0].label].disabled = true;
 document["query"][this.questions[1].label].disabled = true;
 document["query"][this.questions[2].label].disabled = true;
 //defines where editing focus should be when the question is opened. You have to define this if you choose to make the sub question with index 0 uneditable.
 document["query"][this.questions[3].label].focus();

}