File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -195,19 +195,21 @@ function initSurvey<?php echo $id ?>(json, theme) {
195
195
if (!!theme) {
196
196
survey<?php echo $ id ?> .applyTheme(theme);
197
197
}
198
- window.survey<?php echo $ id ?> = survey<?php echo $ id ?> ;
198
+ window.survey<?php echo $ id ?> = survey<?php echo $ id ?> ;
199
199
survey<?php echo $ id ?>
200
200
.onComplete
201
- .add(function (result) {
201
+ .add(function (sender, options) {
202
+ options.showSaveInProgress();
202
203
jQuery.ajax({
203
204
url: "<?php echo esc_url ($ saveResultUri ) ?> ",
204
205
type: "POST",
205
- data: { SurveyId: '<?php echo $ id ?> ', Json : JSON.stringify(result.data) },
206
- success: function (data) {}
206
+ data: { SurveyId: '<?php echo $ id ?> ', Json : JSON.stringify(sender.data) },
207
+ success: function (data) {options.showSaveSuccess();},
208
+ error: function (xhr) {options.showSaveError(xhr.responseText);}
207
209
});
208
210
//document
209
211
// .querySelector("#surveyResult-<?php echo $ id ?> ")
210
- // .innerHTML = "result: " + JSON.stringify(result .data);
212
+ // .innerHTML = "result: " + JSON.stringify(sender .data);
211
213
});
212
214
213
215
survey<?php echo $ id ?> .onUploadFiles.add((_, options) => {
You can’t perform that action at this time.
0 commit comments