Last active
December 20, 2020 08:34
-
-
Save fischerbach/5c3a83f7e2077b98532205d1e8ccae74 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Survey.StylesManager.applyTheme("modern"); | |
var surveyJSON = { | |
"pages": [{ | |
"name": "page1", | |
"elements": [{ | |
"type": "rating", | |
"name": "rate", | |
"title": "On a scale of one to five, how likely are you to recommend our website to a friend or colleague? *", | |
"minRateDescription": "(Most unlikely)", | |
"maxRateDescription": "(Most likely)" | |
}] | |
}] | |
} | |
function sendDataToServer(survey) { | |
//send Ajax request to your web server. | |
alert("The results are:" + JSON.stringify(survey.data)); | |
} | |
var survey = new Survey.Model(surveyJSON); | |
$("#surveyContainer").Survey({ | |
model: survey, | |
onComplete: sendDataToServer | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Gist for the article:
How to create online survey for free with SurveyJS and Google Sheets