Loading ...
Sorry, an error occurred while loading the content.

Re: autocomplete: Control text used to populate text box

Expand Messages
  • jennykhan
    Hi there, As long as you are not enabling delimited queries, the easiest thing for you would be to subscribe to the itemSelectEvent and update the textbox
    Message 1 of 2 , Jan 30, 2007
    • 0 Attachment
      Hi there,

      As long as you are not enabling delimited queries, the easiest thing
      for you would be to subscribe to the itemSelectEvent and update the
      textbox explicitly with your custom value:


      //Define the event handler
      var myEventHandler = function(ac, element, data) {
      //Update textbox with custom value
      YAHOO.util.Dom.get("myTextbox").value = "my custom value";
      };

      // Subscribe to the custom event
      myAutoComp.itemSelectEvent.subscribe(myEventHandler);


      Hope that helps,
      Jenny




      --- In ydn-javascript@yahoogroups.com, "fk327" <federico@...> wrote:
      >
      > Hi,
      >
      > I have my autocomplete object and datasource working fine. I defined
      > my own formatResult function to control how results are displayed in
      > the inbox, however when the user selects one of the entries in the
      > listbox the completion text (the text inserted in the textbox) is only
      > the search key, is there any way to control what text is used to
      > populate the text field? Any help will be appreciated.
      >
      > Thanks.
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.