Have an idea?

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

Auto fill data

we have a list for 3 columns

Promoter ID
Shop Name
Shop Address

we need if we enter the promoter ID ( which is numeric question ).
Shop name and Shop Address automatically appear
asked Jun 17, 2020 by Ossama Hasan
This is a grid question, right?  With the first column being numeric and the other two being open-ends?
Yes , or we can go with selected question and 2 open ended questions.

the easiest way we can go with it

1 Answer

0 votes
Please try this script:

<script>
$(document).ready(function(){
    // Parameters
    var codeField = 'GridQ_r1_c1';
    var nameField = 'GridQ_r1_c2';
    var addressField = 'GridQ_r1_c3';
    
    var specialCode = 11;
    var specialName = 'Name!';
    var specialAddress = 'Address!';
    
    // Run
    $('#' + codeField).keyup(function(){
        if (SSI_GetValue(codeField) == specialCode) {
            $('#' + nameField).val(specialName);
            $('#' + addressField).val(specialAddress);
        }
    });
})
</script>


Lines 4-6 must be the names of the fields.  I've included an example for a grid question, but these could be replaced with the names of your select and open-end questions instead.

Lines 8-10 control the special promoter ID value and the automatic texts to place into the text fields.
answered Jun 17, 2020 by Zachary Platinum Sawtooth Software, Inc. (171,950 points)
...