Non Selectable Items in ADC Grids

Non Selectable Items in ADC Grids

Summary This article describes how to disable the input of certain cells in your ADC grid questions using css and javascipt
Applies to askiadesign
Written for Survey scripter
Keywords ADC; ADX; Responsive Table; Vertical Table; Horizontal Table; Grid; Loop; Parent; Child; Input; Disable; Question table.


Non selectable items in grid questions has a solution where you apply a small piece of script in the modalities of the response block:


!!On(CI(1)=1,"style='display:none;' disabled='true'","")!!



This will hide responses A & B for the first iteration:



This method, however, is not compatible with grids which use ADCs. Instead, a different approach is required. The example .qex file can be downloaded here.

We have a simple loop set-up:


loopx iterations/responses:


qx responses:


The asterisks (*) denote which cells to disable when their row and column intersect in the response grid. The screen set-up looks like this:



Note the sections of the style/script syntax where we have:


These these focus on which row (tr) (response of loopx) to hide and disable.


Similarly, note these sections where focus on which cell/column position (td) (response of qx) to hide and disable. The '+1' part is to account for the first title column which does not relate to a response of qx


These 3 parts of the syntax could be simply replaced by 1, 2 & 3 but then the cell hiding would not work when randomisation is enabled on the loop and child question. In the example .qex you will see randomisation is used for both and the hidden cells are always correctly set.


Hopefully the above is enough for you to adapt or extend the css/javascript in the example and apply it to your own cell hiding requirements in ADC grids.

Have more questions? Submit a request