Have an idea?

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

Terminate survey option in alert box


I have a select question where one of the options is "Prefer not to Answer." If a respondent chooses this option, is it possible to call an alert box with the message

"We respect your privacy, but we need to your answer for you to proceed with the survey.  If you would still prefer not to answer, please select "Next"

where if they exit out of the alert box, they can answer, and if they click "Next," they will be terminated?

I suspect this would require custom javascript verification, but I'm not sure how I can include a link to a terminate screen.
asked Nov 9 by jzu633 (190 points)

1 Answer

0 votes
You can handle linking to the termination question by adding a skip to your select question.  The skip should skip from the select question to the termination question; the logic of the skip depends on whether the select is a single response or a multiple response.

For radio buttons, use this skip logic:

SelectQ = 10

For checkboxes, use this skip logic:

SelectQ_10 = 1

In both codes, "SelectQ" should be replaced with the name of the select question and "10" should be replaced with the position of the "prefer not to answer" response.

The code for the alert message also depends on the type of select question.

For a radio button select, add this script to the select question:

function SSI_CustomGraphicalRadiobox(graphicalObj, inputObj) {
    if (SSI_GetValue('[% QuestionName() %]') == 10) {
        alert('alert message');

Or for checkboxes:

function SSI_CustomGraphicalCheckbox(graphicalObj, inputObj, bln) {
    if (bln && SSI_GetValue('[% QuestionName() %]_10')) {
        alert('alert message');

Again, the "10" should be replaced with the position of the special response option.

Does that help?
answered Nov 9 by Zachary Platinum Sawtooth Software, Inc. (63,900 points)