Difference between revisions of "Disable sub questions in text grids"

From Catglobe Wiki
Jump to: navigation, search
(New page: -Challenge You want to show the content of a text sub question, but prevent the respondent from editing it. -Code : quest.init = function() { //Set thoes sub question will be disab...)
 
Line 5: Line 5:
 
quest.init = function()
 
quest.init = function()
 
{
 
{
   //Set thoes 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;

Revision as of 09:56, 2 March 2009

-Challenge

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();

}