Panel

Container - Create a complex layout by using Panel element

                        

    
        Survey.StylesManager.applyTheme("default");
    


var json = {
 "pages": [
  {
   "name": "page1",
   "elements": [
    { "type": "rating", "name": "satisfaction", "title": "How satisfied are you with the Product?", "mininumRateDescription": "Not Satisfied", "maximumRateDescription": "Completely satisfied" },
    {
      "type": "panel",
      "innerIndent": 1,
      "name": "panel1",
      "title": "Please, help us improve our product",
      "visibleIf": "{satisfaction} < 3",
      "elements": [
        {
          "type": "checkbox",
          "choices": [
            {
              "value": "1",
              "text": "Customer relationship"
            },
            {
              "value": "2",
              "text": "Service quality"
            },
            {
              "value": "3",
              "text": "Support response time"
            }
          ],
          "name": "What should be improved?"
        },
        {
          "type": "comment",
          "name": "suggestions",
          "title": "What would make you more satisfied with the Product?"
        },
        {
         "type": "panel", "innerIndent": 1, "name": "panel2", "title": "Send us your contact information (optionally)", "state":  "collapsed",
         "elements": [
            { "type": "text","name":  "name", "title":  "Name:" },
            { "type": "text", "inputType": "email","name":  "email", "title":  "E-mail"  }
         ]
        }
      ]
    }
   ]
  }
 ]
};

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


survey.onComplete.add(function(result) {
    document.querySelector('#surveyResult').innerHTML = "result: " + JSON.stringify(result.data);
});

survey.data = {satisfaction: 2};

$("#surveyElement").Survey({ 
    model: survey 
});


                    
<!DOCTYPE html>
<html>
<head>
    <title>Container - Create a complex layout by using Panel element, jQuery Survey Library Example</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <script src="https://unpkg.com/jquery"></script>
<script src="https://surveyjs.azureedge.net/1.0.50/survey.jquery.js"></script>
<link href="https://surveyjs.azureedge.net/1.0.50/survey.css" type="text/css" rel="stylesheet" />
    <link rel="stylesheet" href="./index.css">

</head>
<body>
                <div id="surveyElement">
            </div>
    <div id="surveyResult"></div>

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

</body>
</html>

Title: default is empty.

survey.pages[0].elements[1].title = yourTitle; survey.render();

Inner Indent: default is 1.

survey.pages[0].elements[1].innerIndent = yourTitle; survey.render();