It's not a secret anymore!
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

Google search

N. Ganapathy

Joined: Apr 16, 2012
Posts: 25

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"

<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(){



<body onload="">

<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

<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();"/>
<label>Matching Address:</label>
<select name="DROPDOWN" id="DROPDOWN" style="width: 300px" size="10" onchange="passvalue();">
<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();">
<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"/>



Thanks in advance
Vishal Shaw
Ranch Hand

Joined: Aug 09, 2012
Posts: 179

Use codetags for your code.

Programming is about thinking, NOT coding
Shailesh Narkhede
Ranch Hand

Joined: Jul 10, 2008
Posts: 368

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.

I agree. Here's the link:
subject: Google search
It's not a secret anymore!