Dynamic TextField Drop Down Pre-fill

C

Chuck

Hello,

I was wondering if the following scenario can be done using plain
Javascript or AJAX. We have an input text box within a form. As soon
as the user starts typing in character into that text box possible
options dynamically appear below that text box so that the user can
simply select an option rather than typing the rest of the data. For
example, in gmail as soon as you start typing in characters into the
To: field (or CC: field or BCC: field) email addresses that start with
the user typed characters dynamically appear. Then the user can
simply select the best match rather than typing in the entire email
address.

I know that this can be done using AJAX and some fancy CSS, but I was
wondering if this can be done without AJAX, i.e. with just plain
Javascript and CSS? If this can only be done with AJAX, what would it
take to throw up AJAX on Tomcat/iPlanet web servers?

Thanks,
--Willard
 
H

Henry

I was wondering if the following scenario can be done using
plain Javascript or AJAX. We have an input text box within
a form. As soon as the user starts typing in character into
that text box possible options dynamically appear below that
text box so that the user can simply select an option rather
than typing the rest of the data.

Remember to think about what happens when/if the user starts deleting
characters.
I know that this can be done using AJAX and some fancy CSS,

The CSS is largely irrelevant, as it only influences how the end
result looks.
but I was wondering if this can be done without AJAX, i.e.
with just plain Javascript and CSS?

If you mean client-side javascript then the problem is the data from
which the choices are offered. For client-side javascript to present
the suggestions it would need to have access to the data and so the
data would have to be transmitted to the client in full. For any
worthwhile system that would be an insane practice.
If this can only be done with AJAX, what would it take to
throw up AJAX on Tomcat/iPlanet web servers?

Remember that AJAX (as it is usually thought of) is just a means of
making HTTP request from client-side javascript (and receiving/working
with the responses). The server is doing nothing more than a server
would usually do; receiving HTTP requests and sending responses. There
would have to be code on the server (servlets/JSPs or the like) to
receive the requests, work out what to suggest (from the database, or
somewhere), and send the lists of suggestions back to the client-side
code for presentation.
 
J

Joost Diepenmaat

Chuck said:
I know that this can be done using AJAX and some fancy CSS, but I was
wondering if this can be done without AJAX, i.e. with just plain
Javascript and CSS?

Yes it can. But the reason you mainly see this as an Ajax solution is
that it's only really useful if the list of possible options is too long
to realistically send to the browser and navigate using standard form
elements.

If your option list isn't that long, you generally don't even need
If this can only be done with AJAX, what would it
take to throw up AJAX on Tomcat/iPlanet web servers?

Nothing special. You just need an url that can be queried and will
return the options in a useful format. Any dynamic web server platform
should already have everything you need.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top