Build JSON Forms and Surveys in Plain JavaScript
SurveyJS for Plain JavaScript is a set of client-side libraries for building custom form and survey management systems in applications built with HTML, CSS, and JavaScript (without frontend frameworks).
Use Form Library to render JSON forms, Survey Creator to design forms visually, Dashboard to analyze responses, and PDF Generator to export forms as PDF files. SurveyJS connects to your own backend, so you keep full control over data storage, access rules, and application logic.
SurveyJS Form Library
- Multi-step forms / form wizard
- Conditional logic
- Dynamic panels / repeatable sections
- Auto-populated fields
- Custom validation
- Calculated values
- Save and restore incomplete forms
SurveyJS Survey Creator
- White-label UI
- Customizable Toolbox & Settings Panel
- UI Preset Editor
- Theme Editor
- Custom question types
- Multi-user form editing
- Localization / translations
SurveyJS Dashboard
- Survey results analysis
- Live response updates
- Response filtering and sorting
- Custom visualizers
- Export responses
- Pivot chart
- Table view
const surveyJson = {
// ...
};
const survey = new Survey.Model(json);
const allQuestions = survey.getAllQuestions();
const node = document.getElementById("survey-dashboard");
fetch("https://www.example.com/survey-results/")
.then(response => response.json())
.then(data => {
const vizPanel = new SurveyAnalytics.VisualizationPanel(
allQuestions,
data
);
vizPanel.render(node);
});
SurveyJS PDF Generator
- Export web forms to PDF
- Generate completed response records
- Fill existing PDF forms
- Create read-only PDF documents
- Apply custom fonts
- Configure PDF page size, orientation, and margins
- Customize PDF themes and layouts
import { SurveyPDF } from "survey-pdf";
function prepareSurveyPDF() {
const surveyPDF = new SurveyPDF(json);
surveyPDF.data = survey.data;
return surveyPDF;
}
function savePdfAsFile() {
const surveyPDF = prepareSurveyPDF();
surveyPDF.save("surveyAsFile.pdf");
}
function savePdfAsBlob() {
const surveyPDF = prepareSurveyPDF();
surveyPDF
.raw("bloburl")
.then(function (bloburl) {
const a = document.createElement("a");
a.href = bloburl;
a.download = "surveyAsBlob.pdf";
document.body.appendChild(a);
a.click();
});
}
function previewPdf() {
const surveyPDF = prepareSurveyPDF();
const oldFrame = document.getElementById("pdf-preview-frame");
if (oldFrame)
oldFrame.parentNode.removeChild(oldFrame);
surveyPDF
.raw("dataurlstring")
.then(function (dataurl) {
const pdfEmbed = document.createElement("embed");
pdfEmbed.setAttribute("id", "pdf-preview-frame");
pdfEmbed.setAttribute("type", "application/pdf");
pdfEmbed.setAttribute("style", "width:100%");
pdfEmbed.setAttribute("height", 200);
pdfEmbed.setAttribute("src", dataurl);
const previewDiv = document.getElementById("pdf-preview");
previewDiv.appendChild(pdfEmbed);
});
}
Survey Management System Examples
SurveyJS UI libraries let you build a full-cycle survey management system inside your VanillaJS application. Users can design forms, publish surveys, submit and review responses, and export completed data to PDF without leaving your app. The same architecture is available for React, Angular, Vue.js, and jQuery.
View examples of such systems for the most popular backend frameworks and CMS.
WordPress
Embed SurveyJS Form Library and Survey Creator in your site using a WordPress plugin.
Domain Model
Generate forms for domain models and edit them in Survey Creator.
Node.js + PostgreSQL
Save forms and user responses in a PostgreSQL database on a Node.js server.
Node.js + MongoDB
Integrate SurveyJS components with a Node.js server that uses a MongoDB database.
Python
Configure client-server interaction of SurveyJS components with a Python backend.
To learn more about how SurveyJS libraries interact with your backend, see the following help topic: Integrate SurveyJS Libraries with Backend
Frequently Asked Questions
Still Got Questions?
Check our FAQ or Contact Us