Have an idea?

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

Auto-submit after three clicks

Hey guys, i know the auto submit code for Choice Tournament in ACBC, but what about Screening Section? How can I adapt it to Screening Section
Got 3 Concepts per Task, so if respondent did his 3 evaluations on the concept (three clicks - possibility or not) the page should submit automatically.

What should I add to this code?

<script>
function SSI_CustomGraphicalRadiobox() {
    SSI_SubmitMe();
}
</script>
asked Jan 22 by Honeybadger Bronze (890 points)

1 Answer

0 votes
This should do the trick:

<script>
function SSI_CustomGraphicalRadiobox() {
    // Settings
    var numberOfConcepts = 3;
    
    // Run
    for (var concept = 1; concept <= numberOfConcepts; concept++) {
        if (!$('[name="[% QuestionName() %]_' + concept + '"]').is(':checked')) {
            return;
        }
    }
    SSI_SubmitMe();
}
</script>
answered Jan 24 by Zachary Platinum Sawtooth Software, Inc. (201,975 points)
many thanks. it works great.
And what about one page with 5 different select questions.
How can I auto submit after the last radio box is checked?

And a second question, I realized that there is no auto-submit for grid questions.
My grid got also 3 Radioboxes to check, but it doesn't work there..
<script>
$(document).ready(function(){
    var names = $('input[type=radio]').get().map(x => x.name).filter(function(item, i, sites) {
        return i == sites.indexOf(item);
    });
    
    SSI_CustomGraphicalRadiobox = function(){
        var submit = true;
        names.forEach(function(name){
            if (!$('[name="' + name + '"]').is(':checked')) {
                submit = false;
            }
        });
        if (submit) {
            SSI_SubmitMe();
        }
    };
})
</script>
...