diff options
author | Frederick Muriuki Muriithi | 2025-01-21 11:10:22 -0600 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2025-01-21 11:10:22 -0600 |
commit | 40c671185952209ca33b95222d519be3207be3ab (patch) | |
tree | 12cf757d54ce50f865cdcde76f085a983842273c /uploader/templates/phenotypes/add-phenotypes-raw-files.html | |
parent | 644c15452fff9769bbd3b1e6723fe6c40cd1bfc9 (diff) | |
download | gn-uploader-40c671185952209ca33b95222d519be3207be3ab.tar.gz |
Submit form: send data to server for processing.
Diffstat (limited to 'uploader/templates/phenotypes/add-phenotypes-raw-files.html')
-rw-r--r-- | uploader/templates/phenotypes/add-phenotypes-raw-files.html | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/uploader/templates/phenotypes/add-phenotypes-raw-files.html b/uploader/templates/phenotypes/add-phenotypes-raw-files.html index b799da7..b720792 100644 --- a/uploader/templates/phenotypes/add-phenotypes-raw-files.html +++ b/uploader/templates/phenotypes/add-phenotypes-raw-files.html @@ -578,8 +578,28 @@ var submitForm = (new_file) => { uploaded_files.add(new_file); if(uploaded_files.size === resumables.length) { - //TODO: build up the new form from existing form and uploaded files - //TODO: submit the form to appropriate endpoint + var form = $("#frm-add-phenotypes"); + if(form.length !== 1) { + // TODO: Handle error somehow? + alert("Could not find form!!!"); + return false; + } + + $.ajax({ + "url": form.attr("action"), + "type": "POST", + "data": processForm(form[0]), + "processData": false, + "contentType": false, + "success": (data, textstatus, jqxhr) => { + // TODO: Redirect to endpoint that should come as part of the + // success/error message. + console.log("SUCCESS DATA: ", data); + console.log("SUCCESS STATUS: ", textstatus); + console.log("SUCCESS jqXHR: ", jqxhr); + }, + }); + return false; } }; |