Have an idea?

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

Javascript not working with IE?

I'm using javascript to pipe in responses to previous questions and disable check boxes (all within a grid question) but I'm finding that some versions of IE do not display this functionality. Is there a setting in Sawtooth to robustly enable Javascript across all browsers, or a more robust way to pipe in past answers and deactivate selection? Thanks!

<script type="text/javascript">
copyTo = "disadvantaged";

[% 
Begin Unverified Perl

my @Answers = ();
my @indices = ();
my @output = ();
my $elem=0;

for($elem=1;$elem<=12;$elem++){
    push @indices, LISTVALUE("MedicalBenefitCtrlsCurr",$elem);    
}

my $elem=0;
for($elem=1; $elem<=12;$elem++){
    push @Answers, GETVALUE("biologicMgmt_r" . $elem . "_c1");
}

my $elem=0;
for($elem=0;$elem<12;$elem++){
    if(@Answers[$elem]>0){
        push @output, @Answers[$elem];
        } else {
            push @output, "999";
        }
        
        }
    


#Using Perl to print out JavaScript array
return "var prior_ans_array_mgmt = [ " . join(",", @output) . "];";

End Unverified
%]

console.log(prior_ans_array_mgmt);

for(var i=0;i<12;i++){
    var j = i+1;
    if (prior_ans_array_mgmt[i]==1) { 
    SSI_SetSelect(copyTo + "_r"+j+"_c1", true);
    }
    if ($("#" + copyTo + "_r"+j+"_c1").length){
        $("#" + copyTo + "_r"+j+"_c1").disabled = true;
    }
    $("#" + copyTo + "_r"+j+"_c1_graphical").addClass('opacity');
    $("#" + copyTo + "_r"+j+"_c1_graphical").removeAttr('id');
}
</script>

<style type="text/css">

    .grid_c1 {
    background-color: lightgrey;
    color: grey;
    }
    
    .opacity {
        background-color: grey;
        z-index: 2;
    }
    
        .col_label_cell.grid_c1 {background-color: grey; color: white; font-weight: bold;}
    .corner_label_cell.grid_c1 {background-color: grey; color: white; font-weight: bold; text-align: right;}
   </style>
asked Sep 19, 2014 by bbedore (210 points)

Your solution to the original question

Please only use this to answer the original question. Otherwise please use comments.
Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:

To avoid this verification in future, please log in or register.
...