howto hidding/overriding history dropdown list of a textbox ?

D

didier Belot

Hi!

If the subject isn't clear:

Modern browsers provide an optional way of remembering user input in
textbox: user begin to type, and a list drop down just under the
textbox showing matching strings already typed.

I just want to provide my own droplist.

Is there an already existing component/script somewhere, and if not,
is there a way of either:
- place some div that cover that builtin list
- feed the builtins list with my own values

Thanks for any help or pointers.
 
R

Randy Webb

didier said:
Hi!

If the subject isn't clear:

Modern browsers provide an optional way of remembering user input in
textbox: user begin to type, and a list drop down just under the
textbox showing matching strings already typed.


I just want to provide my own droplist.

Then instead of a text input, use a select element.
Is there an already existing component/script somewhere, and if not,

See above.
is there a way of either:
- place some div that cover that builtin list
No.

- feed the builtins list with my own values

No.
 
D

didier Belot

Randy said:
Then instead of a text input, use a select element.

Yes. There is a good example, the nearest of what I want, at evolt.com:
http://evolt.org/article/Dynamically_Filtering_Dropdown_Lists_in_Javascript/17/55035/

The problem with only a select is: the list can't be populated before
the user type in some chars; it's about the classical "suggest as you
type" ported to the web, with a distant MySQL server : we don't want to
load a select with 10000+ records, but as soon as we have 3/4 letters,
we can load a smaller list (using either xmlrpc or the iframe technique)
and begin offering suggestions to user...

(...)

last attempt ;-) : disable that builtin list ?
(I guess the answer is... no)

Anyway, thanks for yous answer.
 
R

Randy Webb

SomeGei said:
You could get rid of the built-in list by randomly generating the field
name...

And in the process, make it 100 times harder (if not more) to retrieve
the form fields when the form is submitted. Thats a bit like shooting
your foot off to get a splinter out of your toe :)
 
R

Randy Webb

didier said:
Yes. There is a good example, the nearest of what I want, at evolt.com:
http://evolt.org/article/Dynamically_Filtering_Dropdown_Lists_in_Javascript/17/55035/


The problem with only a select is: the list can't be populated before
the user type in some chars; it's about the classical "suggest as you
type" ported to the web, with a distant MySQL server : we don't want to
load a select with 10000+ records, but as soon as we have 3/4 letters,
we can load a smaller list (using either xmlrpc or the iframe technique)
and begin offering suggestions to user...

If the list is that extensive, then you may want to look into breaking
it down into categories then. Maybe even a dependent select element
situation where the 4th (or so) depends on the 3rd depends on the 2nd
depends on the 1st. And yes, with some solid planning, it could be
implemented without a JS dependency.
(...)



last attempt ;-) : disable that builtin list ?
(I guess the answer is... no)

You guessed right :) Its a user preference and js can't override user
preferences (thankfully).

Other than what was suggested in another reply, of giving that text
field a random name. Use the onchange event handler to populate the
actual field before submission. Then you have introduced a needless
dependency on JS and annoyed your users that have the prefs set to show
that list :)
Anyway, thanks for yous answer.

Welcome.
 

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

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top