possible to allow a user to type directly into a dropdown list to add new item?

Discussion in 'ASP .Net' started by Dica, Nov 8, 2005.

  1. Dica

    Dica Guest

    i've got a dropdown list with various options added to it. i want to add a
    button that allows the user to "Add New Option' which should create a blank
    row on the dropdown list and allow the user to type directly into it.

    is this possible?
    Dica, Nov 8, 2005
    #1
    1. Advertising

  2. RE: possible to allow a user to type directly into a dropdown list to

    Have a textbox (or 2 if you want a seperate value/text) and then you should
    be able to .Add() and item to the List that you are binding to the control.
    Alot depends on how you are binding it though.

    You can also do it clientside with javascript if you can grab the ID of the
    the control.

    --
    Curt Christianson
    site: http://www.darkfalz.com
    blog: http://blog.darkfalz.com



    "Dica" wrote:

    > i've got a dropdown list with various options added to it. i want to add a
    > button that allows the user to "Add New Option' which should create a blank
    > row on the dropdown list and allow the user to type directly into it.
    >
    > is this possible?
    >
    >
    >
    =?Utf-8?B?Q3VydF9DIFtNVlBd?=, Nov 8, 2005
    #2
    1. Advertising

  3. Dica

    Bruce Barker Guest

    not with the dropdown. you can build buy a new one (basically a text box
    with javascript to create the drown menu with dhtm), or popup a textbox that
    is filled in then update the dropdown. if done clientside, you will need to
    pass the info to the server in a hiddenfield.

    -- bruce (sqlwork.com)



    "Dica" <> wrote in message
    news:...
    > i've got a dropdown list with various options added to it. i want to add a
    > button that allows the user to "Add New Option' which should create a
    > blank
    > row on the dropdown list and allow the user to type directly into it.
    >
    > is this possible?
    >
    >
    Bruce Barker, Nov 8, 2005
    #3
  4. Dica,

    I think the way to do this would be with css and javascript. You could click
    your new item button and have it float a textbox directly over the dropdown.
    Then after the user types into the textbox use a postback on enter key press
    to post back and truly add the item to the drop down list, database, and
    whatever else you need to do with it.

    For finding the correct spot to float the javascript I have a
    ScrollToElement and post back on enter key press methods in a Javascript
    component that I give away free you could use to find where to float the
    textbox and to do the postback with. You may find them at:
    http://www.aboutfortunate.com?page=javascriptdemo


    --
    Sincerely,

    S. Justin Gengo, MCP
    Web Developer / Programmer

    www.aboutfortunate.com

    "Out of chaos comes order."
    Nietzsche
    "Dica" <> wrote in message
    news:...
    > i've got a dropdown list with various options added to it. i want to add a
    > button that allows the user to "Add New Option' which should create a
    > blank
    > row on the dropdown list and allow the user to type directly into it.
    >
    > is this possible?
    >
    >
    S. Justin Gengo, Nov 8, 2005
    #4
  5. Dica

    Dica Guest

    "S. Justin Gengo" <justin@[no_spam_please]aboutfortunate.com> wrote in
    message news:...
    > Dica,
    >
    > I think the way to do this would be with css and javascript. You could

    click
    > your new item button and have it float a textbox directly over the

    dropdown.
    > Then after the user types into the textbox use a postback on enter key

    press
    > to post back and truly add the item to the drop down list, database, and
    > whatever else you need to do with it.
    >
    > For finding the correct spot to float the javascript I have a
    > ScrollToElement and post back on enter key press methods in a Javascript
    > component that I give away free you could use to find where to float the
    > textbox and to do the postback with. You may find them at:
    > http://www.aboutfortunate.com?page=javascriptdemo


    interesting solution. tks for the suggestion.

    >
    >
    > --
    > Sincerely,
    >
    > S. Justin Gengo, MCP
    > Web Developer / Programmer
    >
    > www.aboutfortunate.com
    >
    > "Out of chaos comes order."
    > Nietzsche
    > "Dica" <> wrote in message
    > news:...
    > > i've got a dropdown list with various options added to it. i want to add

    a
    > > button that allows the user to "Add New Option' which should create a
    > > blank
    > > row on the dropdown list and allow the user to type directly into it.
    > >
    > > is this possible?
    > >
    > >

    >
    >
    Dica, Nov 9, 2005
    #5
    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. Big Dave
    Replies:
    4
    Views:
    6,841
    Tomas
    Aug 2, 2007
  2. Colin Steadman
    Replies:
    9
    Views:
    794
    Colin Steadman
    Oct 27, 2003
  3. blouie
    Replies:
    6
    Views:
    327
    blouie
    Mar 29, 2007
  4. Harry
    Replies:
    3
    Views:
    110
    Fred Hirschfeld
    Apr 16, 2004
  5. Namor
    Replies:
    0
    Views:
    241
    Namor
    Jan 19, 2006
Loading...

Share This Page