I am using SurveyJS with a little bit of Vue. I want to make the Radio button looks like a button, because I think SurveyJS has no "button-like" for the choices.
this is what it looks like:
Here's my index.html:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Survey Prototype</title><meta name="viewport" content="width=device-width"/>
<script src="https://unpkg.com/vue@2.6.14/dist/vue.js"></script>
<script src="https://unpkg.com/survey-core@1.9.20/survey.core.min.js"></script>
<script src="https://unpkg.com/survey-core@1.9.20/survey.i18n.min.js"></script>
<script src="https://unpkg.com/survey-vue-ui@1.9.20/survey-vue-ui.min.js"></script>
<link href="https://unpkg.com/survey-core@1.9.20/defaultV2.min.css" type="text/css" rel="stylesheet"/>
<link rel="stylesheet" href="./style.css"></head>
<body>
<div id="surveyElement" style="display:inline-block;width:100%;">
<survey :survey='survey'/>
</div>
<div id="surveyResult"></div>
<script type="text/javascript" src="./index.js"></script>
</body>
</html>
and here's my index.js:
Survey
.StylesManager
.applyTheme("defaultV2");
const json = {
pages: \[
{
questions: \[
{
type: "radiogroup",
name: "Question 1",
title: "Deliver through others.",
choices: \[
"Not effective",
"Neither effective nor Effective",
"Effective"
\]
},
{
type: "radiogroup",
name: "Question 2",
title: "Understand others perspective.",
choices: \[
"Not effective",
"Neither effective nor Effective",
"Effective"
\]
},
{
type: "radiogroup",
name: "Question 3",
title: "Solve complex problems.",
choices: \[
"Not effective",
"Neither effective nor Effective",
"Effective"
\]
},
\]
}
\]
};
window.survey = new Survey.Model(json);
survey
.onComplete
.add(function (sender) {
let data = JSON.stringify(sender.data)
data = data.replaceAll("Not effective", "A")
data = data.replaceAll("Neither effective nor Effective", "B")
data = data.replaceAll("Effective", "C")
var obj = JSON.parse(data)
document
.querySelector('#surveyResult')
.textContent = "Result JSON:\\n" + JSON.stringify(obj, null, 3);
});
var app = new Vue({
el: '#surveyElement',
data: {
survey: survey
}});
How can I target the type="radiogroup" in css, to manipulate its looks. To make it look like a button? I tried this post: Making radio buttons look like buttons instead but it doesn't work. Please send help.