To display suggestions in a text box 3 Answer(s) 4 years and 9 months ago
Posted in : Ajax
View Answers
October 13, 2008 at 3:55 PM
Hi friend,
This can be done by using the Ajax :
Some steps to be memeber :
1)Create a text box on the JSP Page. 2)On this text box call a function onKeyUp event using Ajax. 3)Pass the value of Keyword to process page Using Ajax. 4)After getting the response you display all the result corressponding to the keyword.
1) Go to flazx.com, Search for Ajax Book 2) Download Book "Ajax on Java" 3) Open the Book and find the below content. chapter 5 =========== + Section 5.2 -------------- ++ Example 5.4 ..................
Rajanikant
October 13, 2008 at 6:13 PM
The code which i am using for my requirement is:
(Here, i am using the static content, i.e, not using database code.)
var xmlHttp; function showHint(str) { if (str.length==0) { document.getElementById("txt1").innerHTML=""; return; } xmlHttp=GetXmlHttpObject() if (xmlHttp==null) { alert ("Your browser does not support AJAX!"); return; } var url="gethint.jsp"; url=url+"?q="+str; url=url+"&sid="+Math.random(); xmlHttp.onreadystatechange=stateChanged; xmlHttp.open("GET",url,true); xmlHttp.send(null); }
function GetXmlHttpObject() { var xmlHttp=null; try { // Firefox, Opera 8.0+, Safari xmlHttp=new XMLHttpRequest(); } catch (e) { // Internet Explorer try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } } return xmlHttp; }
function stateChanged() { if (xmlHttp.readyState==4) { document.getElementById("txt1").value=xmlHttp.responseText; } } </script> </head> <body> <form> First Name:<input type="text" id="txt1" name="put" onkeyup="showHint(this.value)"> </form> </body> </html>
First Name: FionaFar<html><head><title>gethints</title><body></body></html>
The result which i am getting is wrong.
It has to display: First Name: Fiona Far
Then, i have to select only one.
Please correct me, if i did any mistake.
Thanks and Regards, Naveen.
Related Pages:
To display suggestions in a text box - Ajax
To displaysuggestions in a text box Hi All,
I have a requirement, to get the suggestions i mean when i enter the alphabet in a textbox(For ex:'A'), the names that starts from 'A' have to display in the textbox
Automatically display in text box - JSP-Servlet
Automatically display in text box Dear Deepak Sir,
When i enter some text in text box.That corresponding value in database,the value display in another textbox using ajax.
Thanks & Regards,
VijayaBabu.M
how to display webservice response in a text box
how to display webservice response in a text box Hallo,
i have created a webservice and when i sended request to my webservice its sending proper response . the point is how to dispaly the response values in a textbox usinj
Display two alert box alternately by clicking on text Display two alert box alternately by clicking on text
In this tutorial , we will discuss about how to display two alert box
alternately by clicking on text line. In this example, a text line is given
,when we click
display diffrence between two dates in a text box - JSP-Servlet display diffrence between two dates in a text box i have these set of codes
//
String di=request.getParameter("timestamp2");
String d2... the days in another textbox when i click inside that test box.lease help me
Simple Text display
to display any text in a text input box using a button click. It is very simple... Simple Textdisplay
 ... that flex panel we have to use a button and a textinput box which are present
how to display data from mysql table in text box using jsp??
how to display data from mysql table in textbox using jsp?? <p>hi, i have a written a code to display data from a mysql table into txtboxes...="row">Reference GPC</th>
113: <td><input type="text" name
Display current date in text box in JSP using javascript Display current date in textbox in JSP using javascript
In this section you will learn how to display current date in textbox using JavaScript.For...;
Today's Date is: <input type="text" id="datetext">
<
J2ME Text Box Example
J2ME TextBox Example
This application illustrates how to create the textbox using TextBox class. The
TextBox class is a Screen that allows the user to enter and edit text
Name Display in alert box - JSP-Servlet
Name Display in alert box Dear Sir,
Please any one help me......... when i enter some value in text that value is already in database display the alert box but the value is not in data base alert box is not display
select box and text box validations
select box and textbox validations hi,
any one please tell me how to set validations for select box and text boxes using bean classes?
thank you
Please visit the following link:
http://www.roseindia.net/jsp/user
Fancy Box plug-in for text, portal & swf file
Fancy Box plug-in for text, portal & swf file
In this section, you will learn how to displaytext, portal & swf file inside
fancy box by clicking... click on any link like text, portal & swf
file, the output will be open
Text box Checking Textbox Checking I want to Write only the word A-Z in a textbox What is the code
Program to read the text from a file and display it on a JFrame.
Program to read the text from a file and display it on a JFrame. import javax.swing.*;
import java.io.*;
import java.lang.*;
import java.awt.... a "}"). Any suggestions ?
Use append() method instead of setText().
Here
two text box problem
two textbox problem i have two textbox in two different pages and same variable use in two textbox when enter value in first textbox it's reflection show in second textbox , how i reduce it in jsf ?
Hi Friend
java script text box
will click submit button the text should be submitted(it shows the value in alert).
i also want the textbox should generate in front of NEW button(next/prev...java script text box hi,
I created a button when i click
enable text box
enable text box Dear all
I would like to enable a textbox by clicking on a button.
pleas ehelp me out how can i do this
regards
JV
Display a dialog box with Java Error Display a dialog box with Java Error
 ... the execution
of a program using javaw ,the program code display a dialog box name Java... you a code that help you in
implementation of dialog box with Java Error
enable text box and label on selection
enable textbox and label on selection hello,
Please tell me how to enable label and textbox on selection of drop down list box.
in drop down list box all values come from database.
please reply
Show Dialog Box in Java
;
Message dialog box is used to display informative...
the message Dialog box. Our program display "Click Me" button on the
window....
showMessageDialog():
This method is used to show a message dialog box which contains
some text
Text box control--keypress event Textbox control--keypress event In my form have a textbox...My requirement is... when is type characters in that box... before typing the 3rd character the space should come automatically or programmatically...the sturucture
Drag a Text Box into dynamic positions
Drag a TextBox into dynamic positions Plz can anyone tell how can i drag a textbox using mouse or arrow keys... Im doing a accounts projects and i need this feature for cheque configuration
auto complete text box - Ajax
auto complete text box How to create auto complete textbox in jsp using ajax technology ? plz giv me steps wise code
css click box
file ..
click boxText
CSS
a {
display:inline-block;
width:30px...css click box I wanted to create a click box in CSS with a hyperlink...; a {
display:inline-block;
width:30px;
height:30px
Popup dialog box in java
Popup dialog box in java How to display popup dialog box in java?
Dialog Box- A dialog box is an independent small window which appear... can also customize Your dialog box button text-
Object[] options={?Yes,Proceed
Display alert box on clicking link Display alert box on clicking link
In this tutorial, we will display alert box... is used to display alert box on clicking link :
$("a").click(function... a "a href" link. On clicking
this link ,a alert box prompt message
Alert Box in Flex
Flex Alert Box Components
Adobe Flex provides many types of components, in this tutorial we will study visual component.
1. Alert Box: In the present tutorial we will see how to display simple text using Alert Box. An Alert Box
Show message and confirm dialog box
this
otherwise message
dialog box will open with text "You clicked...
Show Message and Confirm Dialog Box - Swing Dialogs
This section show you how to display several
Display values in textbox on selecting checkbox Display values in textbox on selecting checkbox
Here we are going to perform action on selecting the checkbox and display the
first five textbox values into next five. We have ten text boxes and a
checkbox. As the user enters value
Problem With Combo Box Editable Property
in the combo box
like when you enter text "S" in the combo box then the names Started with "S"
will Automatically Display as Combo Box Items.
So will you...Problem With Combo Box Editable Property Hi I am new To Flex
i had
Text preview on a Image - Struts Text preview on a Image Hi,
How to display the text(characters) on a corresponding image.Suppose i want to display the text which i entered... that function in the script.The text i entered in the textbox is displayed
Auto Complete Text Box - JSP-Servlet
Auto Complete Text Box Please help me in Aotocomplete textbox code.
I m a java programmer.
I m working on jsp tech.
please give me the code for Autocomplete textbox in which the values will generate from database table
create text box by clicking button and submittong text in text box using submit
create textbox by clicking button and submittong text in textbox using... is created. and i want to do that when i enter the text input in textbox and when i... box in SOP). i also want the textbox should generate in front of NEW button
Fancy Box plug-in for Images
Fancy Box plug-in for Images
In this section, you will learn how to use fancy box image slider plug-in for
image display. This plug in is very easy to use...;Content-Type" content="text/html; charset=UTF-8" />
<meta http
display from select box - JSP-Servlet display from select box I am doing a jsp project. In this jsp project i have to show the photos in one cell depending on the selection from other selection box which is in the same page.
The photos are stored
JSP Text Box properties. - JSP-Servlet
JSP TextBox properties. How do I restrict a textbox created in JSP page only for numbers..
example: I have a function something like this in actionscript
UserID_txt.restrict = "0-9abc^d-zA-Z~!@#$%^&*()+_-'.,";
Do i have
Auto Complete Text Box - JSP-Servlet
Auto Complete TextBox - JSP-Servlet Auto Complete TextBox Please help me in Aotocomplete textbox code. I m a java programmer. I m working on jsp tech. please give me the code for Autocomplete textbox in which the values
Change background color of text box - Java Beginners
Change background color of text box Hi how can i change the background color to red of Javascript textbox when ever user enters an incorrect value while on entering a correct value its background color should change green
On click Checkbox values displayed in text box
On click Checkbox values displayed in text box Hi sir,
If i onclick the checkbox values should be displayed in textbox, the following code is working properly in Internet Explorer browser but its not working in Google chrome
On click Checkbox values displayed in text box
On click Checkbox values displayed in text box Hi sir,
If i onclick the checkbox values should be displayed in textbox, the following code is working properly in Internet Explorer browser but its not working in Google chrome
JavaScript display variable in alert
JavaScript display variable in alert How to display variable in alert box? I am using javascript.
<html>
<head>
<script type="text/javascript">
function showAlert() {
var name = "Roseindia
populating text box using jsp code
populating textbox using jsp code Sir,
How to populate related values in a textbox after selecting value from drop down list using JSP and mysql...").selectedIndex;
var val = document.getElementById("book").options[cid].text
Display the Shadow of the string Display the Shadow of the string
This section illustrates you to display the shadow of the specified
string.
To display the shadow, we have used the class
how to get selected name from combo box
of worker name within d combo box and display that id into a textbox.
plz...how to get selected name from combo box i have fetched all records of worker i.e worker name. on a test.jsp
and dispayed it into combo box ...my
how to get selected name from combo box
of worker name within d combo box and display that id into a textbox.
plz...how to get selected name from combo box i have fetched all records of worker i.e worker name. on a test.jsp
and dispayed it into combo box ...my
dynamic display - JSP-Servlet
dynamic display hi,
i want to display dynamic values in drop drown box in a jsp page.these values are in the form of arraylist's object which... connection=null;
ResultSet rs;
response.setContentType("text/html");
List