Kiwizoom
Kiwizoom

Reputation: 443

autofill textbox automatically

I am working on a bug creation web interface that's hosted on a server. What it does is create and move bugs regarding a product.

There is a simple form textbox thusly

<asp:TextBox ID="YName" runat="server" Text="" autocomplete="on" onClick="YName_Click" />

It is to tie all changes to the bug with the person's name (it was defaulting to servername before.)

The problem is autocomplete is on, yes, but that means it remembers the value when you start typing. The goal is to have it filled automatically so we don't have type anything. We go through a lot of bug maintenance, too much typing and it would be nice to be able to track down every change to a person, not a server.

Most of the help I've seen is just turn autocomplete on, but I haven't seen much yet regarding filling automatically. Does it require some cookies or something? Browser manipulating? I don't know.

Upvotes: 0

Views: 157

Answers (1)

Ryan Schlueter
Ryan Schlueter

Reputation: 2221

You can use Jquery autocomplete against either a server or by manually inserting the values. http://jqueryui.com/autocomplete/ So once you get the library you can just do something like this

 $(function() {
    var availableTags = [
      "ActionScript",
      "AppleScript",
      "Asp",
      "BASIC",
      "C",
      "C++",
      "Clojure",
      "COBOL",
      "ColdFusion",
      "Erlang",
      "Fortran",
      "Groovy",
      "Haskell",
      "Java",
      "JavaScript",
      "Lisp",
      "Perl",
      "PHP",
      "Python",
      "Ruby",
      "Scala",
      "Scheme"
    ];
    $( "#tags" ).autocomplete({
      source: availableTags
    });

Upvotes: 1

Related Questions