From fdb0862d8b187d5a8a89fa4965e820e8b424356a Mon Sep 17 00:00:00 2001
From: Ted Trask
Date: Tue, 26 Jan 2010 08:51:32 +0000
Subject: Added autofill so autocompletes when only one matching did.
---
did-assigndefinition-html.lsp | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/did-assigndefinition-html.lsp b/did-assigndefinition-html.lsp
index f054ae1..8139e17 100644
--- a/did-assigndefinition-html.lsp
+++ b/did-assigndefinition-html.lsp
@@ -15,15 +15,21 @@
io.write(table.concat(tab, " ")) %>".split(" ");
$("#did").focus();
$("#did").attr('autocomplete', 'off');
- $("#did").autocomplete(data);
+// $("#did").autocomplete(data);
+ $("#did").autocomplete(data, {autoFill:true});
// $("#did").autocomplete("cgi-bin/acf/did/did/searchdefinitionlist");
+ $("#did").result(function(event,data,formatted) {
+ if (data) {
+ $("#rules").focus();
+ };
+ });
$("#did").progress(function(event,data) {
// The data is the number of results
if (lastdata != data) {
lastdata = data;
if (data == 1) {
$("#diderrtxt").html("");
- $("#extension").focus();
+ $("#rules").focus();
}
else if (data == 0)
$("#diderrtxt").html("No result");
@@ -31,7 +37,6 @@
$("#diderrtxt").html("");
};
});
-
});
@@ -48,13 +53,12 @@
io.write("
\n")
end %>
-
--
cgit v1.2.3