Hi, Support Team!
I was trying to follow your example here: https://surveyjs.io/form-library/examples/custom-theme/jquery#content-code to change some text colors, button colors, etc, but to no avail. Theme = modern.
What did I do wrong?
My survey.js file looks something like this (called from Blazor ):
JavaScriptSurvey.StylesManager.applyTheme("modern");
var defaultThemeColors = Survey.StylesManager.ThemeColors["modern"];
defaultThemeColors["$main-color"] = "#92C14D";
defaultThemeColors["$main-hover-color"] = "#92C14D";
defaultThemeColors["$text-color"] = "#92C14D";
defaultThemeColors["$header-color"] = "#92C14D";
defaultThemeColors["$header-background-color"] = "#4a4a4a";
defaultThemeColors["$body-container-background-color"] = "#f8f8f8";
Survey.StylesManager.applyTheme();
let patientSurvey = new Survey.Model();
export function setIsDoctorValue(isDoctor) {
patientSurvey.getQuestionByName("IsDoctor").value = isDoctor;
};
export function setPatientName(PatientName) {
patientSurvey.description = "Patient Name: " + PatientName;
};
export function setSurveyJsonData(JsonData, SurveyResult, objRef) {
patientSurvey = new Survey.Model(JsonData);
patientSurvey.data = JSON.parse(SurveyResult);
$("#surveyElement").Survey({ model: patientSurvey });
patientSurvey.onComplete.add(function (sender) {
objRef.invokeMethodAsync('SendJsonSurveyResult', JSON.stringify(sender.data, null, 3));
document.querySelector('#surveyResult').textContent = "You will be redirected to your submissions page in 4 seconds...";
});
};
patientSurvey.onComplete.add(function (sender) {
DotNet.invokeMethodAsync('MHU.Blazor.Public', 'SendJsonSurveyResult', JSON.stringify(sender.data, null, 3));
});