Make whole cell clickable in single and multi grids: Difference between revisions
From Catglobe Wiki
More actions
Line 1: | Line 1: | ||
== Challenge == | == Challenge == | ||
Normally, the grid question require | Normally, the grid question require a click on the checkbox or radiobutton. Now, we want it to register the answer when the user click on the cell for the answer option. | ||
== Example == | == Example == | ||
[[Image:Clickable_cell.gif ]] | [[Image:Clickable_cell.gif ]] |
Revision as of 13:47, 27 January 2010
Challenge
Normally, the grid question require a click on the checkbox or radiobutton. Now, we want it to register the answer when the user click on the cell for the answer option.
Example
Script
quest.onInit = function()
{
$(".grid_subquestion_odd,.grid_subquestion_even").click(
function(evt)
{
if(evt.target.nodeName == "INPUT")
return true;
$(this).children("input").click();
return false;
});
}