Autocomplete Extender

Discussion in 'ASP .Net' started by Juan Romero, Oct 3, 2007.

  1. Juan Romero

    Juan Romero Guest

    Hi guys,

    I have an ajax autocomplete extender working fine but I would like to
    populate the textbox with a different value from what the user selects. For
    example:

    User selects "CODE - Description of CODE here".
    Textbox gets "CODE" only, not "CODE - Description of CODE here".

    Thank you in advance!
     
    Juan Romero, Oct 3, 2007
    #1
    1. Advertising

  2. Juan Romero

    Lloyd Sheen Guest

    "Juan Romero" <> wrote in message
    news:uvGk$...
    > Hi guys,
    >
    > I have an ajax autocomplete extender working fine but I would like to
    > populate the textbox with a different value from what the user selects.
    > For example:
    >
    > User selects "CODE - Description of CODE here".
    > Textbox gets "CODE" only, not "CODE - Description of CODE here".
    >
    > Thank you in advance!
    >


    The way that is normally done in a dropdown is to have a "Text" value which
    is displayed and a "Value" value which holds the text to be used. You would
    have to get the source (available) for the toolkit and change the logic
    since the webservice routine that is used returns a simple array of strings.
    You would need an array of objects that contain a text/value pair.

    I looked into the code but this is the first time I have looked at the code
    for the extenders and my Javascript is not that great.

    LS
     
    Lloyd Sheen, Oct 3, 2007
    #2
    1. Advertising

  3. Juan Romero

    Juan Romero Guest

    Thank you Lloyd.

    I did the same thing and my Javascript is not that great either, lol....

    Anyways for anyone else out there looking for this, I just found out that a
    new version of the AjaxControlToolkit was just released a few days ago and
    it includes a change to the AutoComplete to address this situation.
    Basically, you are now able to pass key/value pairs. They still get passed
    as a string but you can work with them through the OnClientItemSelected
    event. Check it out!

    "Lloyd Sheen" <> wrote in message
    news:...
    >
    > "Juan Romero" <> wrote in message
    > news:uvGk$...
    >> Hi guys,
    >>
    >> I have an ajax autocomplete extender working fine but I would like to
    >> populate the textbox with a different value from what the user selects.
    >> For example:
    >>
    >> User selects "CODE - Description of CODE here".
    >> Textbox gets "CODE" only, not "CODE - Description of CODE here".
    >>
    >> Thank you in advance!
    >>

    >
    > The way that is normally done in a dropdown is to have a "Text" value
    > which is displayed and a "Value" value which holds the text to be used.
    > You would have to get the source (available) for the toolkit and change
    > the logic since the webservice routine that is used returns a simple array
    > of strings. You would need an array of objects that contain a text/value
    > pair.
    >
    > I looked into the code but this is the first time I have looked at the
    > code for the extenders and my Javascript is not that great.
    >
    > LS
     
    Juan Romero, Oct 3, 2007
    #3
  4. Juan Romero

    Lloyd Sheen Guest

    "Juan Romero" <> wrote in message
    news:%...
    > Thank you Lloyd.
    >
    > I did the same thing and my Javascript is not that great either, lol....
    >
    > Anyways for anyone else out there looking for this, I just found out that
    > a new version of the AjaxControlToolkit was just released a few days ago
    > and it includes a change to the AutoComplete to address this situation.
    > Basically, you are now able to pass key/value pairs. They still get passed
    > as a string but you can work with them through the OnClientItemSelected
    > event. Check it out!
    >
    > "Lloyd Sheen" <> wrote in message
    > news:...
    >>
    >> "Juan Romero" <> wrote in message
    >> news:uvGk$...
    >>> Hi guys,
    >>>
    >>> I have an ajax autocomplete extender working fine but I would like to
    >>> populate the textbox with a different value from what the user selects.
    >>> For example:
    >>>
    >>> User selects "CODE - Description of CODE here".
    >>> Textbox gets "CODE" only, not "CODE - Description of CODE here".
    >>>
    >>> Thank you in advance!
    >>>

    >>
    >> The way that is normally done in a dropdown is to have a "Text" value
    >> which is displayed and a "Value" value which holds the text to be used.
    >> You would have to get the source (available) for the toolkit and change
    >> the logic since the webservice routine that is used returns a simple
    >> array of strings. You would need an array of objects that contain a
    >> text/value pair.
    >>
    >> I looked into the code but this is the first time I have looked at the
    >> code for the extenders and my Javascript is not that great.
    >>
    >> LS

    >
    >


    Do you know which version that is. I updated about a couple of weeks ago so
    I may already have this version and should give it a try.

    LS
     
    Lloyd Sheen, Oct 3, 2007
    #4
    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. GMartin
    Replies:
    0
    Views:
    402
    GMartin
    Nov 20, 2006
  2. =?Utf-8?B?Ym9iYnk=?=

    AutoComplete extender

    =?Utf-8?B?Ym9iYnk=?=, Sep 13, 2007, in forum: ASP .Net
    Replies:
    1
    Views:
    682
    densial
    Sep 13, 2007
  3. Stefan Filip

    AJAX Autocomplete Extender problem

    Stefan Filip, Nov 21, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    5,309
    yuriy.loginov
    Aug 28, 2012
  4. Rey
    Replies:
    2
    Views:
    3,535
    warrenvt
    Jun 19, 2008
  5. JM_newsgroups
    Replies:
    0
    Views:
    707
    JM_newsgroups
    Jun 12, 2008
Loading...

Share This Page