*
The moose likes JSP and the fly likes Google search Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSP
Bookmark "Google search " Watch "Google search " New topic
Author

Google search

N. Ganapathy
Greenhorn

Joined: Apr 16, 2012
Posts: 24

I am trying google search funtionality .How to change text box into Listbox dynamically or how to load all the values of listbox in textbox. I am getting search results in combo box now i want load the search results into textbox. is ther anyway to use text box as listbox.
My jsp code
<%--
Document : index
Created on : Aug 6, 2012, 5:51:25 PM
Author : Administrator
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<meta http-equiv="Pragma" content="no-cache"> <meta http-equiv="Cache-Control" content="no-cache"> <meta http-equiv="Expires" content="Sat, 01 Dec 2001 00:00:00 GMT">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<link rel="stylesheet" type="text/css" href="/prowebapp/web/css/bondstyle.css" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Address Search</title>
<script language="javascript" src="Scripts/Ajaxcalling.js"></script>

<script language="javascript">
function passvalue(){

document.getElementById('name').value=document.getElementById('DROPDOWN').value;

}
</script>


</head>
<body onload="document.DPIDS.name.focus()">

<div id="StateCombo" style="border-right: #000000 thin solid; border-top: #000000 thin solid;
font-weight: normal; border-left: #000000 thin solid; width:540px; border-bottom: #000000 thin solid;
height: 10px; background-color: gainsboro">

<form name="DPIDS">
<table class=textgreyboldTable>
<%
response.setHeader("Pragma", "no-cache");
response.setDateHeader("Expires", 0); //prevents caching at the proxy server
response.setHeader("Cache-Control", "max-stale=0"); // HTTP 1.1
%>

<tr>
<td>
<label>Address              :</label>


<input type="textarea" id="name" name="name" class=textInputDetails style="width: 300px" size="10" onkeyup="onKey();"/>

<input type="button" id="GetAdd" class="button3" value=" Go " onclick="getAddress();"/>
</td>
</tr>
<tr>
<td>
<label>Matching Address:</label>
<select name="DROPDOWN" id="DROPDOWN" style="width: 300px" size="10" onchange="passvalue();">
</select>
</td>
</tr>
<tr>
<td align="center">
<input type="button" id="SetValue" name="SetValue" class="button3" value=" Ok " onclick="GetMoniker();"/>
<input type="button" id="cancel" name="cancel" value="Cancel" onclick="window.parent.close();">
</td>
</tr>
<input type="hidden" id="dpid" name="dpid" class='textInputBox'>
<input type="hidden" name="Street" id="Street"/>
<input type="hidden" name="len" id="len"/>
<
<input type="hidden" name="Suburb" id="Suburb"/>
<input type="text" name="Postcode" id="Postcode" style="visibility: hidden"/>
<input type="hidden" name="Barcode" id="Barcode"/>
<input type="hidden" name="Statecode" id="Statecode"/>



</table>

</form>
</div>
</body>
</html>

Thanks in advance
Vishal Shaw
Ranch Hand

Joined: Aug 09, 2012
Posts: 179
Hi,

Use codetags for your code.


Programming is about thinking, NOT coding
Shailesh Narkhede
Ranch Hand

Joined: Jul 10, 2008
Posts: 368
Hi,

Functionality you want to implement is called as Autocomplete functionality.

If you google with this term you will get plenty of result for how to implement it.


Thanks,
Shailesh
 
GeeCON Prague 2014
 
subject: Google search