Radiogroup

One choice - Radio Group question

                        

    
        Survey.StylesManager.applyTheme("default");
    


var json = { questions: [
    { type: "radiogroup", name: "car", title: "What car are you driving?", isRequired: true, 
     colCount: 4, choices: ["None", "Ford", "Vauxhall", "Volkswagen", "Nissan", "Audi", "Mercedes-Benz", "BMW", "Peugeot", "Toyota", "Citroen"] }
]};

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


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


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


                    
<!DOCTYPE html>
<html>
<head>
    <title>One choice - Radio Group question, 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.59/survey.jquery.js"></script>
<link href="https://surveyjs.azureedge.net/1.0.59/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>
There are several ways to set the 'choices' property.
// The classic way to set the property. The result values are numbers: 1 and 2
choices: [{ value: 1, text: "Value 1" }, { value: 2, text: "Value 2" }]
// The values are: 1 and 'Value 2' and texts are '1' and 'Value 2'
choices: [{ value: 1 }, { value: "Value 2" }]
// The values and texts are same
choices: ["Value 1", "Value 2"]
// The values are '1' and '2' and texts are 'Value 1' and 'Value 2'
choices: ["1|Value 1", "2|Value 2"]

Column count: (default is 1)

var q = survey.getQuestionByName('car');
q.colCount = yourValue; 
survey.render();

Choices order: (default is 'none')

var q = survey.getQuestionByName('car');
q.choicesOrder = yourvalue; 
survey.render();

var q = survey.getQuestionByName('car');
q.hasOther = yourvalue; 
survey.render();

Others text

var q = survey.getQuestionByName('car');
q.otherText = yourvalue; 
survey.render();