Index: lams_central/web/includes/javascript/comments.js =================================================================== diff -u -r5297fc67fa56d2984dfa874443ebcf7ddc6a0ca8 -r67f128090c1d1c1e8ec3b987477c17c7df8d6bdd --- lams_central/web/includes/javascript/comments.js (.../comments.js) (revision 5297fc67fa56d2984dfa874443ebcf7ddc6a0ca8) +++ lams_central/web/includes/javascript/comments.js (.../comments.js) (revision 67f128090c1d1c1e8ec3b987477c17c7df8d6bdd) @@ -42,3 +42,16 @@ alert(errorCannotRedisplayMessage); } } + + /** Disable the submit button when pressed to stop double submission. disabled = true doesn't stop the link working it just + * greys it out. So we need to test with isDisabled() in the submit methods too! Messy. */ + function disableButton(buttonId) { + $("#"+buttonId).attr("disabled", true); + } + function isDisabled(buttonId) { + return $("#"+buttonId).attr("disabled"); + } + function enableButton(buttonId) { + $("#"+buttonId).removeAttr("disabled"); + } +