I have a survey which has radio group for user to select value. However, when I load the saved the json. The radio group does highlight the radio button. For example, I have choose 3 as the answer. When the save documents is loaded, it only show the 3th button with darker color but not with the selected button highlighted. What is the problem?
surveyjs radiobutton load saved values does not highlight radiobutton
Answers approved by surveyjs Support
Hello Simon,
I believe you are talking about rating question and there is something wrong with survey styles on your page. Could you please check that you correctly load css files and/or set theme.
Thank you,
Andrew
SurveyJS Team
You are using wrong css file. Please go to any of our example and then select "HTML" and "JavaScript" tabs. You will see the correct css files based on selected theme, "modern" by default. You will need to apply the following code in JavaScript for modern theme:
JavaScriptSurvey.StylesManager.applyTheme("modern");
You are using css for SurveyJS Creator. It is another library, survey creator/builder, and it is under commercial license.
Thank you,
Andrew
SurveyJS Team
code edited:
ASPx$(document).ready(function () {
SetStyleToButton('<%=uiSave2.ClientID%>');
SetStyleToButton('<%=uiApprove.ClientID%>');
Survey.StylesManager.applyTheme("modern");
ASPx<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<link rel="stylesheet" href="css/jquery-ui-1.12.0.css" />
<link href="https://unpkg.com/survey-knockout@1.8.21/modern.css" type="text/css" rel="stylesheet"/>
ASPx<telerik:RadScriptBlock ID="uiRadScriptBlock" runat="server">
<script src="js/plugins/surveyjs/survey.jquery.min.js"></script>
<script src="js/plugins/surveyjs/showdown.min.js"></script>
The output is still same
Hello Simon,
This is how it should look like.
Please make sure that css is loaded and this line of code executed before creating the survey:
JavaScriptSurvey.StylesManager.applyTheme("modern");
Thank you,
Andrew
SurveyJS Team