Cart Buy Licenses Contact Integrate into App Docs Support Login/Register
v 1.9.7
v 1.9.7
Overview Survey Creator Survey Creator V2 Examples Docs Source

Country component

Select country component


//Register new "country" component
  //Unique component name. It becomes a new question type. Please note, it should be written in lowercase.
  name: "country",
  //The text that shows on toolbox
  title: "Country",
  //The actual question that will do the job
  questionJSON: {
    type: "dropdown",
    optionsCaption: "Select a country...",
    choicesByUrl: {
      url: "",

                var creatorOptions = { showLogicTab: true };
                var creator = new SurveyCreator.SurveyCreator("creatorElement", creatorOptions);
                creator.showToolbox = "right";
                creator.showPropertyGrid = "right";
creator.JSON = {
    elements: [
            type: "country",
            name: "question1"
//Select the order table component
creator.selectedElement = creator.survey.getAllQuestions()[0];
//Show property grid
<!DOCTYPE html>
<html lang="en">
    <title>Select country component, Survey Creator Example</title>

<meta name="viewport" content="width=device-width" />
    <script src=""></script>
    <script src="/DevBuilds/survey-knockout/survey.ko.min.js"></script>
    <script src="" type="text/javascript" charset="utf-8"></script>
    <script src="" type="text/javascript" charset="utf-8"></script>
    <!-- Uncomment to enable Select2
    <script src=""></script>
    <link href="" rel="stylesheet" />
    <script src=""></script>
        <script src="/DevBuilds/survey-creator/survey-creator.min.js"></script>
        <link href="/DevBuilds/survey-creator/survey-creator.min.css" type="text/css" rel="stylesheet" />
    <link rel="stylesheet" href="">
    <link rel="stylesheet" href="./index.css">

    To learn more about "country" component please read <a href="/Documentation/Survey-Creator?id=Build-Component-Questions#countryexamples"  target="_blank">our documentation</a>
</div><div id="surveyContainer">
        <div id="creatorElement"></div>

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