]> git.plutz.net Git - lobster/blobdiff - therapies/autosave.js
introduce transaction id for therapy updates
[lobster] / therapies / autosave.js
index b4020ddce94ca1a4db7cfbcccfb81af67ea3849e..665a6011463ff7de12fa5e064847910805be58c1 100644 (file)
@@ -4,6 +4,7 @@ var formdata = '';
 
 function postsubmit(){
   if ( this.status == 200 ) {
+    document.querySelector('#report input[name="tid"]').setAttribute('value', this.response);
     console.log('successful auto submit of form data');
     button.setAttribute('style', 'display: none;');
   } else {
@@ -18,7 +19,7 @@ function failsubmit(){
 
 function formencode(fd){
     var send;
-    send='autosubmit=false';
+    send='autosubmit=true';
     for (var tup of fd.entries()){
       send += '&' + encodeURIComponent(tup[0]) + '=' + encodeURIComponent(tup[1]);
     }