...

View Full Version : text field with a search popup



ruwan
08-11-2006, 09:00 AM
hi all,

I want to create a text field, in that text field when the user type few letters of the related word automatically similar words has to list in the popup, the list I can set on the .js file or anther text file, please give me a help for this

:confused:

vwphillips
08-11-2006, 11:09 AM
http://www.vicsjavascripts.org.uk/AutoCompleteAutoComplete.htm

Aruna Attanayak
08-11-2006, 11:40 AM
hi
this javascript coding might help u.but you have to improve the code according to u r requirement. following javascript code will open a popup window and get the value u typed in parent page.This code will open the popup window as u type single letter.for filtering list you need to write more code.

//copy and save following code as popup.php
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<form name="form1" method="post" action="">
<input type="text" name="txtTest" onKeyUp="popup();">
</form>
</body>
</html>
<script>
function popup () {


window.open('test.php','window','left=0,top=0,width=720,height=300,scrollbars=yes,status=yes,resizab le=0');


}
</script>


//copy and save following code as test.php

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<form name="form1" method="post" action="">
<input type="text" name="txtLetter">
</form>
</body>
</html>
<script>

document.form1.txtLetter.value = window.opener.document.form1.txtTest.value;

</script>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum