diff options
author | BonfaceKilz | 2021-06-01 16:34:08 +0300 |
---|---|---|
committer | BonfaceKilz | 2021-06-01 17:09:05 +0300 |
commit | 8de5c32c4846b0382ded05ddb633ab67e5e062c8 (patch) | |
tree | b0d988c7f81997dce81d86e8d163cd7ab24a5a09 | |
parent | d0b78700c788281b8be0372784088cc021f24b00 (diff) | |
download | genenetwork2-8de5c32c4846b0382ded05ddb633ab67e5e062c8.tar.gz |
templates: edit_trait: Only submit form elements that have changed
We only submit form elements that have changed, and use that to update
the relevant tables. See: https://stackoverflow.com/a/5221915
-rw-r--r-- | wqflask/wqflask/templates/edit_trait.html | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/wqflask/wqflask/templates/edit_trait.html b/wqflask/wqflask/templates/edit_trait.html index 2cd8a6fd..05bdebd1 100644 --- a/wqflask/wqflask/templates/edit_trait.html +++ b/wqflask/wqflask/templates/edit_trait.html @@ -162,5 +162,13 @@ Submit Trait | Reset {% block js %} <script> gn_server_url = "{{ gn_server_url }}"; + function MarkAsChanged(){ + $(this).addClass("changed"); + } + $(":input").blur(MarkAsChanged).change(MarkAsChanged); + + $("input[type=submit]").click(function(){ + $(":input:not(.changed)").attr("disabled", "disabled"); + }); </script> {% endblock %} |