howto hidding/overriding history dropdown list of a textbox ?

Discussion in 'Javascript' started by didier Belot, Aug 29, 2004.

  1. didier Belot

    didier Belot Guest

    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.
    --
    dib
    didier Belot, Aug 29, 2004
    #1
    1. Advertising

  2. didier Belot

    Randy Webb Guest

    didier Belot wrote:
    > 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.



    --
    Randy
    comp.lang.javascript FAQ - http://jibbering.com/faq
    Randy Webb, Aug 29, 2004
    #2
    1. Advertising

  3. didier Belot

    didier Belot Guest

    Randy Webb wrote:
    > didier Belot wrote:
    >
    >> 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.


    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...

    (...)

    >> is there a way of either:
    >> - place some div that cover that builtin list

    >
    > No.
    >
    >> - feed the builtins list with my own values

    >
    > No.


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

    Anyway, thanks for yous answer.
    --
    dib
    didier Belot, Aug 29, 2004
    #3
  4. didier Belot

    SomeGei Guest

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

    "didier Belot" <> wrote in message
    news:cgsep4$36v$.9tel.net...
    > 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.
    > --
    > dib
    SomeGei, Aug 29, 2004
    #4
  5. didier Belot

    Randy Webb Guest

    SomeGei wrote:
    > 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 :)



    --
    Randy
    comp.lang.javascript FAQ - http://jibbering.com/faq
    Randy Webb, Aug 29, 2004
    #5
  6. didier Belot

    Randy Webb Guest

    didier Belot wrote:

    > Randy Webb wrote:
    >
    >> didier Belot wrote:
    >>
    >>> 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.

    >
    >
    > 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.

    > (...)
    >
    >>> is there a way of either:
    >>> - place some div that cover that builtin list

    >>
    >>
    >> No.
    >>
    >>> - feed the builtins list with my own values

    >>
    >>
    >> No.

    >
    >
    > 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.

    --
    Randy
    comp.lang.javascript FAQ - http://jibbering.com/faq
    Randy Webb, Aug 29, 2004
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Phil Streiff

    howto: Chg textbox visible on dropdown selection?

    Phil Streiff, May 21, 2004, in forum: ASP .Net Web Controls
    Replies:
    5
    Views:
    320
  2. Sam Stephenson
    Replies:
    1
    Views:
    215
    Andrew Walrond
    Jun 18, 2005
  3. Replies:
    2
    Views:
    278
    nutso fasst
    Oct 17, 2006
  4. Niall
    Replies:
    3
    Views:
    156
    Niall
    Dec 6, 2006
  5. ulyx

    hidding dropdown menu

    ulyx, Dec 13, 2006, in forum: Javascript
    Replies:
    5
    Views:
    96
Loading...

Share This Page