JavaScript Survey and Form Library

Overview

SurveyJS is a JavaScript Survey and Form Library.

SurveyJS is a modern way to add surveys and forms to your website. It has versions for Angular, jQuery, knockout, react and vue.

Build Status Software License Tested with TestCafe Issues Closed issues

Documentation

SurveyJS Library Documentation

Live Examples

SurveyJS Library Live Examples

Survey Creator / Form Builder

Create your Survey or Form now

Survey Creator sources are here

Export Survey to PDF

Export to PDF overview

Export to PDF sources are here

More info about SurveyJS

SurveyJS is the most feature-rich Survey / Form Library available at the current moment. It can be easily customized and extended to suit your needs.

alt tag

Main Features

A lot of question types with a lot of built-in functionalities.

Multiple Pages Support

You may create a very complex forms with a lot of pages, like this one.

Dynamically change survey logic and questions content

Localization and Multiple language support

Appearance and custom Rendering

Frequently used functionalities

To find out more about the library

You can use our quickstart repos:

Getting started

Install the library using npm.

Angular version:

npm install survey-angular

jQuery version:

npm install survey-jquery

Knockout version:

npm install survey-knockout

React version:

npm install survey-react

Vue version:

npm install survey-vue

Or use unpkg CDN:

You find all versions/builds in the surveyjs/build repo.

Or dowload a version as zip file from Releases

If you want to import it in another script:

import * as Survey from "survey-jquery";

Building survey.js from sources

To build library yourself:

  1. Clone the repo from GitHub

    git clone https://github.com/surveyjs/survey-library.git
    cd survey-library
    
  2. Acquire build dependencies. Make sure you have Node.js installed on your workstation. You need a version of Node.js greater than 6.0.0 and npm greater than 2.7.0. This is only needed to build surveyjs from sources.

    npm install -g karma-cli
    npm install
    
  3. Build the library

    npm run build_prod
    

    After that you should have the libraries (angular, jquery, knockout, react and vue) at 'packages' directory.

  4. Run samples

    npm start
    

    This command will run local http server at the http://localhost:7777 You can open http://localhost:7777/examples/knockout to view KnockoutJS samples, http://localhost:7777/examples/react to view ReactJS samples and so on

  5. Run unit tests

    karma start
    

    This command will run unit tests using Karma

WordPress integration

SurveyJS WordPress plugin

License

MIT license

Comments
  • Is it possible to add dynamic matrix column wise

    Is it possible to add dynamic matrix column wise

    Are you requesting a feature, reporting a bug or ask a question?

    Question/Feature

    What is the current behavior?

    Able to add dynamic matrix row wise. is there a possibility to add them column wise?

    What is the expected behavior?

    Add the dynamic matrix questions column wise

    How would you reproduce the current behavior (if this is a bug)?

    Provide the test code and the tested page URL (if applicable)

    Tested page URL:

    Test code

    your_code_here
    
    

    Specify your

    • browser: google chrome
    • browser version:
    • surveyjs platform (angular or react or jquery or knockout or vue): angular 5
    • surveyjs version: 1.0.22
    enhancement question 
    opened by ashygk 56
  • Custom widgets in matrixdynamic

    Custom widgets in matrixdynamic

    Hello, my intention is to embed select2tagbox in matrixdynamic. Is there any generic way to do so?

    Using JQuery I'm trying to override the 'cellType' property of matrixdropdownbase class

    JsonObject.metaData.addClass("matrixdropdownbase", [ ..... { name: "cellType", default: "dropdown", choices: ["dropdown", "checkbox", "radiogroup", "text", "comment"] } ..... ],

    with select2tagbox property (as mentioned in the select2tagbox example) but I'm not sure if it'll work.

    Is this feasible ?

    enhancement 
    opened by brydko 52
  • Request: More Customization

    Request: More Customization

    Are you requesting a feature, reporting a bug or ask a question?

    • Requesting a feature, allowing customization of the survey template itself, being able to add custom classes to question elements, etc.

    What is the expected behavior?

    • Being able to customize the template, or in this specific case, being able to tie another existing button to be used as the 'next/complete' button.

    How would you reproduce the current behavior (if this is a bug)?

    N/A

    question 
    opened by Braunson 33
  • React-Native support & using surveyjs without front end libraries.

    React-Native support & using surveyjs without front end libraries.

    Are there plans to support React Native? I have a need for mobile surveys; however, surveyjs service seems to have a dependency on the front end.

    Is there a way to request the survey json via https without the frontend library?

    enhancement 
    opened by safaiyeh 29
  • Support multiple entities form / questionnaire

    Support multiple entities form / questionnaire

    Are you requesting a feature, reporting a bug or ask a question?

    feature / question

    What is the current behavior?

    We would like to support multiple entities questionnaire forms.

    In our situation, it's a medical form that the questionnaire form should display for each of the entities.

    we discussing if the solution should be UI based only or be part of surveryjs solution API

    for example, if there was an API that we can ask the same question for 1..N entities and upon survey submission, we will get the data for each entity.

    also - it could be much more complex because each entity can get a different survey path as each entity answer can result in a different UI based on visibleIf condition.

    Any idea/comment will be more than helpful.

    best

    question 
    opened by IDIBuild 27
  • React is not defined

    React is not defined

    I have a fresh "create-react-app" install (https://github.com/facebookincubator/create-react-app).

    • I ran npm install survey-react --save (everything is alright, something new in node modules!)
    • Then I added import 'survey-react/dist/survey.react.min' right after import React, { Component } from 'react'; in App.js
    • Run the server with npm start

    Running it says:

    survey.react.min.js:10 Uncaught ReferenceError: React is not defined

    Is there any way to work around this problem? (feel free to close this issue if it's not relative to your lib!)

    bug 
    opened by rap2hpoutre 27
  • Unable to process binding

    Unable to process binding "template: function (){return { name:'survey-content',afterRender:koEventAfterRender} }"

    With the latest version, i got :

    Uncaught ReferenceError: Unable to process binding "template: function (){return { name:'survey-content',afterRender:koEventAfterRender} }"
    Message: Unable to process binding "if: function (){return koState() =="running" }"
    Message: Unable to process binding "template: function (){return { name:'survey-page',data:koCurrentPage,afterRender:koAfterRenderPage} }"
    Message: Unable to process binding "text: function (){return koNo() + processedTitle }"
    Message: koNo is not defined
        at text (eval at parseBindingsString (knockout-min.js:61), <anonymous>:3:129)
        at update (knockout-min.js:91)
        at function.a.j.q (knockout-min.js:66)
        at l (knockout-min.js:44)
        at Object.a.w.a.j (knockout-min.js:47)
        at knockout-min.js:66
        at Object.o (knockout-min.js:10)
        at g (knockout-min.js:65)
        at h (knockout-min.js:63)
        at k (knockout-min.js:63)
    
    question 
    opened by nelero 26
  • Surveyjs-vue not working with last vue cli

    Surveyjs-vue not working with last vue cli

    Are you requesting a feature, reporting a bug or asking a question?

    Bug

    What is the current behavior?

    universalModuleDefinition?2436:1 Uncaught TypeError: Cannot read property 'Vue' of undefined

    How would you reproduce the current behavior (if this is a bug)?

    Just simply use the surveyjs_vue_quickstart to use surveyjs

    Specify your

    • browser: chrome
    • browser version: lastest
    • surveyjs platform (angular or react or jquery or knockout or vue): vue cli v3.0.0-rc.3
    • surveyjs version: 1.0.30
    bug help wanted 
    opened by xibman 25
  • Feature Request for Error Validation onBlur

    Feature Request for Error Validation onBlur

    Are you requesting a feature, reporting a bug or asking a question?

    Feature request.

    What is the current behavior?

    checkErrorsMode has three options - onNextPage, onValueChanged and onComplete.

    What is the expected behavior?

    One of the most common options to validate is onBlur. onValueChaged works quite fine for most cases but triggers validation prematurely occasionally. E.g upon partial entry in a Date field.

    It would be nice to have one more option to trigger validation when the user focuses away after an input (onBlur event). Alternately, limit trigger to occur after the user enters a minimum number of characters.

    How would you reproduce the current behavior (if this is a bug)?

    Feature request.

    Provide the test code and the tested page URL (if applicable)

    Not applicable

    Tested page URL:

    Test code

    your_code_here
    
    

    Specify your

    • browser: Chrome
    • browser version:Version 81.0.4044.122 (Official Build) (64-bit)
    • surveyjs platform (angular or react or jquery or knockout or vue): react
    • surveyjs version: latest
    question 
    opened by shekharkc 22
  • Reset current choosed value when pressing

    Reset current choosed value when pressing "back" button

    Are you requesting a feature, reporting a bug or asking a question?

    question

    What is the current behavior?

    selecting: question1 - any value question2 - any value question3 - any value

    after going back to question1 and going forward: question2 - value selected question3 - value selected

    What is the expected behavior?

    selecting: question1 - any value question2 - any value question3 - any value

    after going back to question1 and going forward: question2 - value should be empty, user need to select again, because it will change visibility of further questions question3 - value should be empty, user need to select again, because it will change visibility of further questions

    How would you reproduce the current behavior (if this is a bug)?

    When scrolling and selecting in: question1 -> question2 -> question3....... , then going back to question1, selecting value and then after going to question2 or any other further - the value of question2 is already selected and not cleared. In this way, it shows questions that shouldn't be visible because there are visibleif statements.

    Provide the test code and the tested page URL (if applicable)

    I will provide my survey URL only for admin.

    Specify your

    • browser: Chrome
    • browser version: up to date
    • surveyjs platform (angular or react or jquery or knockout or vue): Jquery
    • surveyjs version: 1.0.71
    question 
    opened by tadas117 22
  • Survey Editor 1.0.58 does not render Select2 and Tagbox custom widgets

    Survey Editor 1.0.58 does not render Select2 and Tagbox custom widgets

    Are you requesting a feature, reporting a bug or asking a question?

    Reporting a bug

    What is the current behavior?

    Survey Js Editor does not render Select2 or Tagbox widgets:

    When I enter the JSON from the tagbox example into the Survey JS editor (v1.0.58),

    {
      "pages": [
        {
         "name": "page1",
          "elements": [
            {
              "type": "dropdown",
              "renderAs": "select2",
              "choicesByUrl": {
                "url": "https://restcountries.eu/rest/v2/all"
              },
              "name": "countries",
              "title": "Please select the country you have arrived from:"
            }
          ]
        }
      ]
    }
    
    

    I receive the error:

    Error: The property 'renderAs' in class 'dropdown' is unknown. The list of available properties are: name, visible, useDisplayValuesInTitle, visibleIf, width, startWithNewLine, indent, page, title, description, commentText, valueName, enableIf, defaultValue, correctAnswer, isRequired, requiredErrorText, readOnly, validators, titleLocation, hasComment, hasOther, choices, choicesOrder, choicesByUrl, hideIfChoicesEmpty, choicesVisibleIf, choicesEnableIf, otherText, otherErrorText, storeOthersAsComment, optionsCaption.
    

    What is the expected behavior?

    It should render the Select2 and Tagbox widgets.

    How would you reproduce the current behavior (if this is a bug)?

    Open the SurveyJS editor and enter the JSON

    Provide the test code and the tested page URL (if applicable)

    Hard to do unfortunately.

    Specify your

    • browser: Chrome
    • browser version: Version 70.0.3538.110
    • surveyjs platform (angular or react or jquery or knockout or vue): Vue
    • surveyjs version: 1.0.58
    bug can't reproduce 
    opened by willgdjones 22
  • Panel Dynamic in Read Only Mode - Display a relevant No Entries text

    Panel Dynamic in Read Only Mode - Display a relevant No Entries text

    In read-only mode, a Panel Dynamic question shows the default message: There are no entries yet. Click the button below to add a new entry. However, this message is irrelevant in read-only mode, because it is impossible to add any entries.

    Suggestion: modify the text for read-only mode. For example: There are no entries.

    Original Issue: T11633 - Dynamic panel: Empty panel label in readonly mode

    enhancement 
    opened by JaneSjs 0
  • Display Current/Maximum Allowed Characters when a maximum length is defined for input fields

    Display Current/Maximum Allowed Characters when a maximum length is defined for input fields

    Usage scenario: Text input fields (e.g., Text, Comment questions) define the maxLength property:

    { 
       "elements": [
        {
         "type": "text",
         "name": "question1",
         "maxLength": 5
        }
       ] 
    }
    

    Display the Current/Max allowed characters for input fields. image

    enhancement 
    opened by JaneSjs 1
  • hasErrors() functions unaware of errors added manually by question.addError()

    hasErrors() functions unaware of errors added manually by question.addError()

    Are you requesting a feature, reporting a bug or asking a question?

    This is a bug report.

    What is the current behavior?

    Calling question.hasErrors() after adding one or more errors by calling question.addErrors() results in the custom errors being lost.

    All variants of hasErrors() are only aware of the SurveyJS errors produced by validators.

    What is the expected behavior?

    My expectation is that calling question.hasErrors(), survey.hasPageErrors(), survey.hasCurrentPageErrors(), or survey.hasErrors() should preserve custom errors manually added to a question by calling addError().

    How would you reproduce the current behavior (if this is a bug)?

    Obtain the instance of a SurveyJS question and call addError() before calling any of the hasErrors() methods available.

    Provide the test code and the tested page URL (if applicable)

    Tested page URL: https://codesandbox.io/s/frosty-grass-cipyl9?file=/src/App.vue

    Test code

    const page = this.survey.activePage;
    const question = this.survey.getQuestionByName("LastName");
    question.addError("This is an error.");
    
    console.log(`question has error sync result`, question.hasErrors());
    console.log(`question has error async handle`, question.hasErrors((hasErrors) => {
      console.log(`question has error async result`, hasErrors);
    }));
    
    console.log(`page error sync result`, this.survey.hasPageErrors(page));
    
    question.addError("This is another error.");
    console.log(`survey has error sync result`, this.survey.hasErrors());
    console.log(`survey has error async handle`, this.survey.hasErrors((hasErrors) => {
      console.log(`survey has error async result`, hasErrors);
    }));
    

    Specify your

    • browser: Firefox, this is not a browser issue.
    • browser version: 109.0b6
    • surveyjs platform (angular or react or jquery or knockout or vue): vue
    • surveyjs version: 1.9
    opened by metaturso 0
  • Provide question-specific alternative to onServerValidateQuestions (async question validation)

    Provide question-specific alternative to onServerValidateQuestions (async question validation)

    It would be beneficial to provide an async event similar to onServerValidateQuestions that gets called according to checkErrorsMode and is passed the instance of the question (IQuestion) it is validating.

    The current validation API is somewhat limiting and it would be nice to avoid iterating all responses passed to onServerValidateQuestions to call getQuestionByName to check the question properties before validating.

    The manual and examples show how one can validate a question by name, e.g. country, but this isn't an approach that scales beyond a handful of questions. For example in a survey where it's the set of properties attached to the question to determine how it should be validated, not its name.

    Using a custom function registered as an expression is an OK solution, if one is willing to put the onus on the survey authors to ensure all questions have those extra validation expressions.

    question 
    opened by metaturso 2
  • custom none value for multiple-choice questions by adding a new noneValue prop

    custom none value for multiple-choice questions by adding a new noneValue prop

    This is related to #5363 and it's another way to show what I am trying to do. Probably it's not ready to be merged but it works. Before this hack I tried to leverage the @RomanTsukanov suggestion but some of the questions are not easy to be reached through the getQuestionByName method as they may be locate inside deeply nested paneldynamic or matrixdynamic. This change will let my app users (who are the ones building the survey model) to write something like:

    {
      "elements": [
        {
          "name": "dropdown",
          "type": "dropdown",
          "choices": [
            1,
            2,
            3,
            4
          ],
          "noneValue": "NA",
          "showNoneItem": true
        },
        {
          "name": "dropdownChoicesByUrl",
          "type": "dropdown",
          "noneValue": "N/A",
          "choicesByUrl": {
            "url": "https://restcountries.com/v2/all",
            "valueName": "name"
          },
          "showNoneItem": true
        }
      ]
    }
    

    PS. I found many bugs over the last years but this is my first PR. Please be patient! thank you

    opened by masciugo 0
Releases(v1.9.66)
✅ Form Validation for Vue.js

vee-validate is a form validation library for Vue.js that allows you to validate inputs and build better form UIs in a familiar declarative style or u

Abdelrahman Awad 9.4k Dec 26, 2022
:clipboard: A schema-based form generator component for Vue.js

vue-form-generator A schema-based form generator component for Vue.js. Demo JSFiddle simple example CodePen simple example Features reactive forms bas

VueJS Generators 2.9k Dec 27, 2022
Termbase für Übersetung in Form eines Obsidian Vault

lang file-id authors date tags topics en 2ff3822a-cc5f-4474-ab4e-d097dcc3a215 [email protected] 2022-01-06 #needs_completion #readme #winos #setup Readme

null 2 Jan 8, 2022
🌊 A flexible and fun JavaScript file upload library

A JavaScript library that can upload anything you throw at it, optimizes images for faster uploads, and offers a great, accessible, silky smooth user

pqina 13.2k Jan 7, 2023
Mobile app development framework and SDK using HTML5 and JavaScript. Create beautiful and performant cross-platform mobile apps. Based on Web Components, and provides bindings for Angular 1, 2, React and Vue.js.

Onsen UI - Cross-Platform Hybrid App and PWA Framework Onsen UI is an open source framework that makes it easy to create native-feeling Progressive We

null 8.7k Jan 4, 2023
The first truly composable CSS animation library. Built for Vue, React, SCSS, and CSS, AnimXYZ will bring your website to life.

AnimXYZ animxyz.com AnimXYZ helps you create, customize, and compose animations for your website. Powered by CSS variables to allow a nearly limitless

Ingram Projects 2.1k Jan 2, 2023
Mosha-vue-toastify - A light weight and fun Vue 3 toast or notification or snack bar or however you wanna call it library.

Mosha Vue Toastify A lightweight and fun Vue 3 toast or notification or snack bar or however you wanna call it library. English | 简体中文 Talk is cheap,

Baidi Liu 187 Jan 2, 2023
🎉 A Vue.js 3.0 UI Library made by Element team

Element Plus - A Vue.js 3.0 UI library ?? Vue 3.0 Composition API ?? Written in TypeScript Status: Beta This project is still under heavy development.

null 18.3k Jan 9, 2023
A lightweight Vue.js UI library with a simple API, inspired by Google's Material Design.

Keen UI Keen UI is a Vue.js UI library with a simple API, inspired by Google's Material Design. Keen UI is not a CSS framework. Therefore, it doesn't

Josephus Paye II 4.1k Jan 2, 2023
Jenesius vue modal is simple library for Vue 3 only

Jenesius Vue Modal Jenesius vue modal is simple library for Vue 3 only . Site Documentation Installation npm i jenesius-vue-modal For add modals in yo

Архипцев Евгений 63 Dec 30, 2022
Small library to accomplish common tasks in Svelte/SvelteKit

svelte-utilities svelte-utilities is a small utilities library for Svelte/SvelteKit that provides features I use in almost every project, such as: Laz

null 40 Nov 25, 2022
🏝 Opinionated Web Components Starter template to help kick-start development of a cross-framework component library.

Web Component Library Starter Kit "Why create components for a specific framework when it can be written to be understood by all — including browsers?

Open Web Labs 14 Dec 24, 2022
🏝 Opinionated Web Components Starter template to help kick-start development of a cross-framework component library.

Web Component Library Starter Kit "Why create components for a specific framework when it can be written to be understood by all — including browsers?

Open Web Labs 5 May 1, 2022
Frolics is an offline, lightweight, full-text search library for Frontend applications

Frolics What Is Frolics Installation Document Preparing Customized Fields Hand-on Example Cache Usage What Is Frolics ? Frolics is an offline, lightwe

null 13 Dec 4, 2022
A library for creating typesafe standardized query keys, useful for cache management in @tanstack/query

Query Key Factory Typesafe query key management for @tanstack/query with auto-completion features. Focus on writing and invalidating queries without t

Luke Morales 446 Jan 3, 2023
NativeScript empowers you to access native api's from JavaScript directly. Angular, Vue, Svelte, React and you name it compatible.

NativeScript empowers you to access native APIs from JavaScript directly. The framework currently provides iOS and Android runtimes for rich mobile de

NativeScript 22k Jan 4, 2023
JavaScript data grid with a spreadsheet look & feel. Works for React, Angular, and Vue. Supported by the Handsontable team ⚡

Handsontable is a JavaScript component that combines data grid features with spreadsheet-like UX. It provides data binding, data validation, filtering

Handsontable 17.4k Dec 31, 2022
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

vue-next This is the repository for Vue 3.0. Quickstart Via CDN: <script src="https://unpkg.com/vue@next"></script> In-browser playground on Codepen S

vuejs 34.6k Jan 9, 2023
Vue Native is a framework to build cross platform native mobile apps using JavaScript

Vue Native Visit our website at vue-native.io or read the official documentation here. Build native mobile apps using Vue Vue Native is a framework to

GeekyAnts 8.4k Jan 6, 2023