Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
71 lines (64 sloc) 2.71 KB
<!DOCTYPE html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" media="screen" href="">
.ui-autocomplete {
max-height: 100px;
overflow-y: auto;
/* prevent horizontal scrollbar */
overflow-x: hidden;
/* add padding to account for vertical scrollbar */
padding-right: 20px;
/* IE 6 doesn't support max-height
* we use height instead, but this forces the menu to always be this tall
* html .ui-autocomplete {
height: 100px;
<h1>jQuery UI Autocomplete sample 3(スクロール付き、カスタムデータ)</h1>
<div class="sample">
<div class="ui-widget">
<label for="bank_search">銀行検索(銀行コードor銀行名): </label>
<input type="text" id="bank_search" style="width:350px">
<form method="GET">
<label for="bank_code">銀行コード: </label>
<input type="text" id="bank_code" style="width:300px" readonly="readonly" name="code">
<label for="bank_name">銀行名: </label>
<input type="text" id="bank_name" style="width:300px" readonly="readonly" name="name">
<input type="submit">
<script type="text/javascript" src=""></script>
<script type="text/javascript" src=""></script>
<script type="text/javascript">
$(function() {
var banks = [
{value: "0001:みずほ銀行", code:"0001", name:"みずほ銀行"},
{value: "0005:三菱東京UFJ銀行", code:"0005", name:"三菱東京UFJ銀行"},
{value: "0009:三井住友銀行", code:"0009", name:"三井住友銀行"},
{value: "0016:みずほコーポレート銀行", code:"0016", name:"みずほコーポレート銀行"},
{value: "0033:ジャパンネット銀行", code:"0033", name:"ジャパンネット銀行"},
{value: "0034:セブン銀行", code:"0034", name:"セブン銀行"},
{value: "0035:ソニー銀行", code:"0035", name:"ソニー銀行"},
{value: "9900:ゆうちょ銀行", code:"9900", name:"ゆうちょ銀行"}];
var opts = {source: banks,
select: function(event, ui){
return false;
$("#bank_search").autocomplete(opts).autocomplete('option', 'minLength', 0);