<HTML>
<HEAD>
<style>
TD{font-family:verdana; font-size:9pt}
SELECT{font-family:verdana; font-size:9pt}
INPUT{font-family:verdana; font-size:9pt}
</style>
<SCRIPT LANGUAGE="JavaScript">
<!--
var arr_string = new Array("김", "김태", "김태희", "김태희 사진", "김태희 싸이");
////////////////////↑DB에서 불러와 배열을 만든다/////////////////////
function input_key(word)
{
if(window.event.keyCode == 40)
{
if (document.all.word_select)
{
document.all.word_select.focus();
document.all.word_select.options[0].selected = true;
}
}
else{
auto_list(word);
}
}
function auto_list(word)
{
var arr_option = new Array();
var k = 0;
// self.status = word;
for (i=0; i<arr_string.length; i++)
{
if(arr_string[i].substring(0, word.length) == word && arr_string[i].substring(0,
word.length) != null)
{
arr_option[k] = arr_string[i];
k = k + 1;
}
}
if(k != 0 && word.length != 0)
{
select.innerHTML = "<select multiple name=\"word_select\" size=\"10\"
style=\"width:250px; height:100px\" onchange=\"document.all.word.value=this.value\"></select>";
for (j=0; j<arr_option.length; j++)
{
document.all.word_select.options[j] = new Option(arr_option[j], arr_option
[j]);
}
document.all['select'].style.visibility = "visible";
}
else{
document.all['select'].style.visibility = "hidden";
}
}
//-->
</SCRIPT>
</HEAD>
<BODY onload="document.all.word.focus();">
<form name="test">
<TABLE width="320" border="0" cellpadding="0" cellspacing="0">
<TR>
<TD width="250"><input type="text" onkeyup="input_key(this.value);" name="word"
style="width:100%"></TD>
<TD><button>search</button></TD>
</TR>
</TABLE>
<div id="select" style="visibility:hidden"><div>
</form>
</BODY>
</HTML>
<HEAD>
<style>
TD{font-family:verdana; font-size:9pt}
SELECT{font-family:verdana; font-size:9pt}
INPUT{font-family:verdana; font-size:9pt}
</style>
<SCRIPT LANGUAGE="JavaScript">
<!--
var arr_string = new Array("김", "김태", "김태희", "김태희 사진", "김태희 싸이");
////////////////////↑DB에서 불러와 배열을 만든다/////////////////////
function input_key(word)
{
if(window.event.keyCode == 40)
{
if (document.all.word_select)
{
document.all.word_select.focus();
document.all.word_select.options[0].selected = true;
}
}
else{
auto_list(word);
}
}
function auto_list(word)
{
var arr_option = new Array();
var k = 0;
// self.status = word;
for (i=0; i<arr_string.length; i++)
{
if(arr_string[i].substring(0, word.length) == word && arr_string[i].substring(0,
word.length) != null)
{
arr_option[k] = arr_string[i];
k = k + 1;
}
}
if(k != 0 && word.length != 0)
{
select.innerHTML = "<select multiple name=\"word_select\" size=\"10\"
style=\"width:250px; height:100px\" onchange=\"document.all.word.value=this.value\"></select>";
for (j=0; j<arr_option.length; j++)
{
document.all.word_select.options[j] = new Option(arr_option[j], arr_option
[j]);
}
document.all['select'].style.visibility = "visible";
}
else{
document.all['select'].style.visibility = "hidden";
}
}
//-->
</SCRIPT>
</HEAD>
<BODY onload="document.all.word.focus();">
<form name="test">
<TABLE width="320" border="0" cellpadding="0" cellspacing="0">
<TR>
<TD width="250"><input type="text" onkeyup="input_key(this.value);" name="word"
style="width:100%"></TD>
<TD><button>search</button></TD>
</TR>
</TABLE>
<div id="select" style="visibility:hidden"><div>
</form>
</BODY>
</HTML>
'asp' 카테고리의 다른 글
ASP/테이블 너비 고정시키기 (0) | 2007.05.03 |
---|---|
순수 ASP만으로 XML을 만들어 테이블에 바인딩 예제 (2) | 2007.05.03 |
Binary 데이타를 받아서 server에 화일로 저장시키는 (2) | 2007.05.03 |
PDF 파일로 변환 (1) | 2007.05.03 |
SiteGalaxyUpload 컴포넌트 사용법 (0) | 2007.05.03 |