Have an idea?

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

Check answers to Checkboxes and set alert

I'm trying to create an alert that reminds a respondent to check their answers before continuing, but I don't want to use strErrorMessage because I don't necessarily want to force a response, just throw up an alert if a sequence of checkboxes were checked.  

I have 5 checkboxes (question name is "er") with descending values:  400, 300, 250, 200,150.  Essentially if they choose 150 I'd like to remind them that they can/should check the other values without forcing them to.  
Something along the lines of (this obviously doesn't work but will hopefully show what I'm attempting):

<script>
function SSI_CustomGraphicalCheckbox(GraphicalCheckboxObj, InputObj, blnCheck)
{
if((InputObj.name == "er_5" && blnCheck == true) && (InputObj.name == "er_4" && blnCheck == false) )
{
alert("Did you check all that are acceptable?");
}
}
</script>


However, I want to make sure that they are shown the alert on submit, not necessarily immediately.  Any ideas would be greatly appreciated.  Using v. 8.4.8
asked Oct 10 by Geoff

1 Answer

0 votes
JavaScript's "confirm" function may be of interest to you.  Custom JavaScript verification like this can be used to confirm whether a respondent is sure about their response:

var confirmed = confirm('Are you sure?');
if (!confirmed) {
    strErrorMessage = 'Change answer and resubmit.';
}


Does that help?
answered Oct 10 by Zachary Platinum Sawtooth Software, Inc. (63,475 points)
I'll give it a shot - thanks Zachary!
...