-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathFormResponse.cshtml
23 lines (23 loc) · 981 Bytes
/
FormResponse.cshtml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
@model FormResponseModel
<script src="https://unpkg.com/survey-core/survey.core.min.js"></script>
<script src="https://unpkg.com/survey-core/survey.i18n.min.js"></script>
<script src="https://unpkg.com/survey-js-ui/survey-js-ui.min.js"></script>
<link rel="stylesheet" href="https://unpkg.com/survey-core/survey-core.min.css" />
<script src="~/js/form_api.js" asp-append-version="true"></script>
<script src="~/js/surveyjs.js" asp-append-version="true"></script>
@{
ViewData["Title"] = "Fill Out a Form: " + Model.FormName;
}
<div id="surveyElement" style="display: inline-block; width: 100%;">
</div>
<script>
loadFormAndData("@Model.FormName", "@Model.Id", showForm);
const survey = new Survey.SurveyModel();
survey.beginLoading();
function showForm(json, data) {
survey.fromJSON(json);
setupSurveyModel(survey, "@Model.FormName");
survey.data = data;
survey.render(document.getElementById("surveyElement"));
}
</script>