From 0598ee6a3b6ef7cba0244d16345c7e49fc26fb58 Mon Sep 17 00:00:00 2001 From: "Alexandr.Lonski" Date: Thu, 20 Apr 2023 12:59:45 +0300 Subject: [PATCH] added re-direct url option in the form settings --- src/Webform.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Webform.js b/src/Webform.js index 74ef0425bd..5709380cbb 100644 --- a/src/Webform.js +++ b/src/Webform.js @@ -1292,6 +1292,7 @@ export default class Webform extends NestedDataComponent { this.loading = false; this.submitting = false; this.setPristine(true); + const redirectUrl = _.get(this.root, 'form.settings.redirect'); // We want to return the submitted submission and setValue will mutate the submission so cloneDeep it here. this.setValue(fastCloneDeep(submission), { noValidate: true, @@ -1305,6 +1306,9 @@ export default class Webform extends NestedDataComponent { this.emit('submit', submission, saved); if (saved) { this.emit('submitDone', submission); + if (redirectUrl) { + window.location.assign(redirectUrl); + } } return submission; }