diff --git a/html/js/scripts.js b/html/js/scripts.js
index 5fd54e19d..401ce3e3b 100644
--- a/html/js/scripts.js
+++ b/html/js/scripts.js
@@ -4052,4 +4052,15 @@ function download_document(p_url)
waiting_box();
document.location=p_url;
remove_waiting_box();
-}
\ No newline at end of file
+}
+/**
+ * @brief download a document from a form
+ */
+function download_document_form(p_form_id)
+{
+ waiting_box();
+ var url="export.php?"+$(p_form_id).serialize();
+ document.location=url;
+ remove_waiting_box();
+ return false;
+}