From f8b39d7d8c75d79eabada83a35c9d83aaf454538 Mon Sep 17 00:00:00 2001 From: Jason White Date: Tue, 10 Jan 2017 15:23:15 -0500 Subject: [PATCH] #303 Clear current form on successful submission --- .../main/resources/static/js/goatApp/view/LessonContentView.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/webgoat-container/src/main/resources/static/js/goatApp/view/LessonContentView.js b/webgoat-container/src/main/resources/static/js/goatApp/view/LessonContentView.js index e5d93e1b8..9e03341b7 100644 --- a/webgoat-container/src/main/resources/static/js/goatApp/view/LessonContentView.js +++ b/webgoat-container/src/main/resources/static/js/goatApp/view/LessonContentView.js @@ -94,6 +94,7 @@ define(['jquery', var prepareDataFunctionName = $(curForm).attr('prepareData'); var submitData = (typeof webgoat.customjs[prepareDataFunctionName] === 'function') ? webgoat.customjs[prepareDataFunctionName]() : $(curForm).serialize(); // var submitData = this.$form.serialize(); + this.curForm = curForm; this.$curFeedback = $(curForm).closest('.attack-container').find('.attack-feedback'); this.$curOutput = $(curForm).closest('.attack-container').find('.attack-output'); var formUrl = $(curForm).attr('action'); @@ -114,6 +115,7 @@ define(['jquery', this.renderOutput(data.output || ""); if (data.lessonCompleted) { + this.curForm.reset(); this.trigger('lesson:complete'); } return false;