PC Review


Reply
Thread Tools Rate Thread

Autocomplete Extender

 
 
Juan Romero
Guest
Posts: n/a
 
      3rd Oct 2007
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!


 
Reply With Quote
 
 
 
 
Lloyd Sheen
Guest
Posts: n/a
 
      3rd Oct 2007

"Juan Romero" <(E-Mail Removed)> wrote in message
news:uvGk$(E-Mail Removed)...
> 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

 
Reply With Quote
 
Juan Romero
Guest
Posts: n/a
 
      3rd Oct 2007
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
> "Juan Romero" <(E-Mail Removed)> wrote in message
> news:uvGk$(E-Mail Removed)...
>> 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



 
Reply With Quote
 
Lloyd Sheen
Guest
Posts: n/a
 
      3rd Oct 2007

"Juan Romero" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>>
>> "Juan Romero" <(E-Mail Removed)> wrote in message
>> news:uvGk$(E-Mail Removed)...
>>> 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

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Ajax Autocomplete Extender style Radu Microsoft ASP .NET 0 9th Oct 2008 07:58 PM
Providing wait message for AJAX 3.5 AutoComplete extender JM_newsgroups Microsoft ASP .NET 0 12th Jun 2008 02:28 PM
AJAX Autocomplete Extender problem =?Utf-8?B?U3RlZmFuIEZpbGlw?= Microsoft ASP .NET 1 27th Nov 2007 02:46 PM
AutoComplete extender =?Utf-8?B?Ym9iYnk=?= Microsoft ASP .NET 1 13th Sep 2007 11:59 PM
AutoComplete Extender Selection Event? GMartin Microsoft ASP .NET 0 20th Nov 2006 10:02 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:36 AM.