From: David ‘Bombe’ Roden Date: Sat, 15 Jan 2011 22:07:33 +0000 (+0100) Subject: Disable all original input fields when form is submitted. X-Git-Tag: 0.4^2~3 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=a1f01b1bc2ceba062c55b46f1de6b38fd7e16070;p=Sone.git Disable all original input fields when form is submitted. This way only the generated input fields/textareas are submitted, and those always contain the real value. Fixes #46. --- diff --git a/src/main/resources/static/javascript/sone.js b/src/main/resources/static/javascript/sone.js index 80d039c..e0c8162 100644 --- a/src/main/resources/static/javascript/sone.js +++ b/src/main/resources/static/javascript/sone.js @@ -47,6 +47,7 @@ function registerInputTextareaSwap(inputElement, defaultText, inputFieldName, op textarea.show(); } $(inputField.get(0).form).submit(function() { + inputField.attr("disabled", "disabled"); if (!optional && (textarea.val() == "")) { return false; }