Enable text field on empty input, request focus.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 2 Apr 2011 22:12:57 +0000 (00:12 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 2 Apr 2011 22:12:57 +0000 (00:12 +0200)
src/main/resources/static/javascript/sone.js

index 8ef92cf..c0fbb6d 100644 (file)
@@ -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;
                                }
                        });