4 Haziran 2014 Çarşamba

jQuery İle Textbox Otomatik Tamamlama (Autocomplete)

Textbox Otomatik Tamamlama (Autocomplete)

Merhaba arkadaşlar aşağıda verilen kodu projenize entegre ediniz. Jsp bilmeyen arkadaşlar kod üzerinde duran Jsp taglarını dikkate almayınız.


<%--
    Document   : newjsp3
    Created on : 04.Haz.2014, 16:26:56
    Author     : ammar.aslan
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>Deneme</title>
  <link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
  <script src="//code.jquery.com/jquery-1.10.2.js"></script>
  <script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
  <link rel="stylesheet" href="/resources/demos/style.css">
  <script>
  $(function() {
    var availableTags = [
      "Ammar",
      "Aslan",
      "Batman",
      "Elazığ",
      "Bartın",
    ];
    $( "#divismi" ).autocomplete({
      source: availableTags
    });
  });
  </script>
</head>
<body>
    <form action="#">
<div class="ui-widget">
  <label for="divismi">Lütfen Giriş Yapınız </label>
  <input id="divismi" type="text" name="a"/>
  <input id="Ammar" type="submit" value="gir" />
<%
String ammar=request.getParameter("a");
if(ammar==null)
out.print("");
else
    out.print(ammar);
%>
</div>
 </form>
</body>
</html>