Buy Licenses Contact Support Login/Register
v 1.5.9
Overview Examples Docs Source Download
v 1.5.9

Custom widget: Select2

Select2 Widget

Third-party libraries: Select2 MIT



var json = {
  "elements": [
      "type": "dropdown",
      "renderAs": "select2",
      "choicesByUrl": {
        "url": ""
      "name": "countries",
      "title": "Please select the country you have arrived from:"

window.survey = new Survey.Model(json);

    survey.onComplete.add(function(result) {
        document.querySelector('#surveyResult').textContent =
            "Result JSON:\n" + JSON.stringify(, null, 3);
    }); = { countries: 'Andorra' };

var app = new Vue({ 
    el: '#surveyElement',
        survey: survey

<!DOCTYPE html>
<html lang="en">
    <title>Select2 Widget, Vue Survey Library Example</title>

    <meta name="viewport" content="width=device-width, initial-scale=1">
    <script src=""></script>
    <script src=""></script>
<script src=""></script>
<link href="" type="text/css" rel="stylesheet" />
    <link rel="stylesheet" href="./index.css">
<script src=""></script>
<link href="" rel="stylesheet" />
    <script src=""></script>

                <div id="surveyElement" style="display:inline-block;width:100%;">
                <survey :survey='survey' />
    <div id="surveyResult"></div>

<script type="text/javascript" src="./index.js"></script>