Skip to content

Commit 049488a

Browse files
committed
update prompt and allow for empty replies
1 parent a0ea8f8 commit 049488a

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

‎v3/js/opt-frontend.js‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -638,9 +638,11 @@ $(document).ready(function() {
638638
}
639639

640640
var buttonPrompt = $(this).html();
641-
var res = prompt('"' + buttonPrompt + '"' + ' Please elaborate:');
642-
// don't submit EMPTY results with no feedback or when Cancel button is pressed
643-
if (res) {
641+
var res = prompt('"' + buttonPrompt + '"' + '\nPlease elaborate if you can and hit OK to submit:');
642+
// don't do ajax call when Cancel button is pressed
643+
// (note that if OK button is pressed with no response, then an
644+
// empty string will still be sent to the server
645+
if (res !== null) {
644646
myArgs.surveyQuestion = buttonPrompt;
645647
myArgs.surveyResponse = res;
646648
$.get('survey.py', myArgs, function(dat) {});

0 commit comments

Comments
 (0)