Buy Licenses Contact Support Login/Register
v 1.5.10
Overview Survey Creator Examples Docs Source Download
v 1.5.10

Minimalistic configuration

Hide multiple page support, hide object selector, custom items editor, custom colors and other customizations


                        //Color customization
var mainColor = "#0065FF";
var mainHoverColor = "#60C5FB";
var textColor = "#4a4a4a";
var headerColor = "#4a4a4a";
var headerBackgroundColor = "#4a4a4a";
var bodyContainerBackgroundColor = "#f8f8f8";

var defaultThemeColorsSurvey = Survey
    .StylesManager
    .ThemeColors["default"];
defaultThemeColorsSurvey["$main-color"] = mainColor;
defaultThemeColorsSurvey["$main-hover-color"] = mainHoverColor;
defaultThemeColorsSurvey["$text-color"] = textColor;
defaultThemeColorsSurvey["$header-color"] = headerColor;
defaultThemeColorsSurvey["$header-background-color"] = headerBackgroundColor;
defaultThemeColorsSurvey["$body-container-background-color"] = bodyContainerBackgroundColor;

var defaultThemeColorsEditor = SurveyCreator
    .StylesManager
    .ThemeColors["default"];
defaultThemeColorsEditor["$primary-color"] = mainColor;
defaultThemeColorsEditor["$secondary-color"] = mainColor;
defaultThemeColorsEditor["$primary-hover-color"] = mainHoverColor;
defaultThemeColorsEditor["$primary-text-color"] = textColor;
defaultThemeColorsEditor["$selection-border-color"] = mainColor;

Survey
    .StylesManager
    .applyTheme();
SurveyCreator
    .StylesManager
    .applyTheme();

//Show Designer, Test Survey, JSON Editor and additionaly Logic tabs
//Show chosen question types in toolbox
//Set single page mode
var options = {
    showLogicTab: true, showJSONEditorTab: false,
    questionTypes: ["text", "checkbox", "radiogroup", "dropdown", "comment",
          "rating", "imagepicker", "boolean", "html", "file", "expression"],
    pageEditMode: "single"
};
//Create the SurveyJS Creator and render it in div with id equals to "creatorElement"
var creator = new SurveyCreator.SurveyCreator("creatorElement", options);
//Show toolbox in the right container. It is shown on the left by default
creator.showToolbox = "right";
//Show property grid in the right container, combined with toolbox
creator.showPropertyGrid = "right";
//Make toolbox active by default
creator.rightContainerActiveItem("toolbox");
//Remove toolbar items except undo/redo buttons
creator.toolbarItems.splice(2, 5);
//Set custom designer placeholder
creator.placeholderHtml = `
<div style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center;">
    <img src="/Content/Images/drag-image.svg" />
    <div style="font-size: 16px; max-width: 210px;">
        Drag and drop a question to start designing your form
    </div>
</div>`;



                    
<!DOCTYPE html>
<html lang="en">
<head>
    <title>Hide multiple page support,  hide object selector, custom items editor, custom colors and other customizations, Survey Creator Example</title>


    <meta name="viewport" content="width=device-width, initial-scale=1">
    <script src="https://cdnjs.cloudflare.com/ajax/libs/knockout/3.4.0/knockout-min.js"></script>
<script src="https://surveyjs.azureedge.net/1.5.10/survey.ko.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.2.0/ace.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.2.0/ext-language_tools.js" type="text/javascript" charset="utf-8"></script>
    <!-- Uncomment to enable Select2
    <script src="https://unpkg.com/jquery"></script>
    <link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/css/select2.min.css" rel="stylesheet" />
    <script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/js/select2.min.js"></script>
    -->
    <link href="https://surveyjs.azureedge.net/1.5.10/survey-creator.css" type="text/css" rel="stylesheet" />
    <script src="https://surveyjs.azureedge.net/1.5.10/survey-creator.js"></script>
    <link rel="stylesheet" href="./index.css">

</head>
<body>
    <link href="https://surveyjs.azureedge.net/1.5.10/survey.css" type="text/css" rel="stylesheet" />
<svg style="display:none;">
    <symbol viewBox="0 0 20 20" id="icon-custom-drag">
        <g>
            <rect x="5" y="0" width="4" height="4" />
            <rect x="11" y="0" width="4" height="4" />
            <rect x="5" y="6" width="4" height="4" />
            <rect x="11" y="6" width="4" height="4" />
            <rect x="5" y="12" width="4" height="4" />
            <rect x="11" y="12" width="4" height="4" />
        </g>
    </symbol>
    <symbol viewBox="0 0 20 20" id="icon-custom-delete">
        <polygon points="15,3 14,2 8.5,7.5 3,2 2,3 7.5,8.5 2,14 3,15 8.5,9.5 14,15 15,14 9.5,8.5 " />
    </symbol>
</svg>
    <div id="surveyContainer">
        <div id="creatorElement"></div>
    </div>

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

</body>
</html>

/* Designer shadow style */
.svd_questions_editor {
    -webkit-box-shadow: 0px 0px 10px 4px rgba(235,235,235,1);
    -moz-box-shadow: 0px 0px 10px 4px rgba(235,235,235,1);
    box-shadow: 0px 0px 10px 4px rgba(235,235,235,1);
}
.svd_container.svd_container.svd_container .btn-primary {
    color: gray;
    background-color: transparent;
    border-color: transparent;
}
.svd_container.svd_container.svd_container .svd_toolbar .icon-white .svd-svg-icon {
    fill: gray;
}
.svd_container .svd_toolbar {
    text-align: right;
}

/*
.svd_container {
    font-family: "Georgia";
    font-size: 16px;
}
.sv_main {
    font-family: "Georgia";
    font-size: 16px;
}
*/

.svd_container.svd_container .nav-tabs > li.active > a[class=nav-link] {
    color: rgb(74, 74, 74);
    border-bottom: 4px solid #0065FF;
}
.svd_container.svd_container .nav-tabs a[class=nav-link] {
    color: rgb(167, 167, 167);
    padding: 0;
    padding-bottom: 8px;
}
.svd_container.svd_container .nav-tabs .nav-item {
    margin-bottom: 10px;
    padding: 10px;
}

.svd-sidebar-title {
    font-size: 20px;
    padding: 10px 30px;
    color: gray;
}

/* Remove/delete button style */
.svd_container .svd-textitems-column .btn.btn-danger {
    background-color: transparent;
    color: rgb(0, 101, 255);
    font-size: 1.5em;
    padding: 5px;
}
.svd-itemvalue-actions-container {
    color: rgb(0, 101, 255);
}

/* Hide object selector */
.svd_object_selector {
    display: none;
}

.svd_object_editor {
    margin-top: 10px;
}