From: David ‘Bombe’ Roden Date: Sat, 2 Apr 2011 22:12:57 +0000 (+0200) Subject: Enable text field on empty input, request focus. X-Git-Tag: 0.6^2~3 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=f0acfe87cd655eb2e15f1dd3bc590c1478e4e8ba;p=Sone.git Enable text field on empty input, request focus. --- diff --git a/src/main/resources/static/javascript/sone.js b/src/main/resources/static/javascript/sone.js index 8ef92cf..c0fbb6d 100644 --- a/src/main/resources/static/javascript/sone.js +++ b/src/main/resources/static/javascript/sone.js @@ -49,6 +49,7 @@ function registerInputTextareaSwap(inputElement, defaultText, inputFieldName, op $(inputField.get(0).form).submit(function() { inputField.attr("disabled", "disabled"); if (!optional && (textarea.val() == "")) { + inputField.removeAttr("disabled").focus(); return false; } });