Have an idea?

Visit Sawtooth Software Feedback to share your ideas on how we can improve our products.

TD's are still clickable even if the inputs are hidden / disabled

Hello, in v7/8 now that the cells of grids are clickable, I've run into a problem. When I disable or hide the inputs of these grids in this version, I can NOT click on the inputs, which is what I want. But, I can still click on the TD and then the input populates. I do not want that.

I'm using beta 8 - testing it with our current code library, so I understand this might be different than the mootools in V7, but basically I need to stop this from happening.

I removed the clickable class for the TD, and that didn't make a difference. And I see the offending code in the Sawtooth JS file. I don't want to just stop the function from the whole survey, just for these specifics cells that end up being hidden / greyed out.

Basically this: document.mainform.q20_c1[1].readOnly = true;  but for the whole cell.
asked Jan 10, 2012 by anonymous

1 Answer

0 votes
I can't verify now but if I recall correct, set
blah_graphical_select.className = "HideElement";
answered Jan 10, 2012 by Bahadir Ozkurt Gold (16,930 points)
Sorry, I should have clarified that I am NOT using the graphical input buttons.
shamelessly stolen from SSI JS and modified a little
<script type="text/javascript">
<!--
    // Remove the default behavior of label tags, which is to select the input when the label is selected.  
    // This behavior together with the stuff below confuses the code.
    var clickableAreas = $$(".clickable");
    for (var inputIndex=0; inputIndex < clickableAreas.length; inputIndex++)
    {
        var ClickableObj = clickableAreas[inputIndex];
        var InputObj = ClickableObj.getElement("input");

        if (InputObj)
        {
            ClickableObj.className = ClickableObj.className.replace('clickable','');
        }
    }
//-->
</script>
...