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

unmatchedItemSelectEvent trouble

Expand Messages
  • mwk80569
    I m trying to use the unmatchedItemSelectEvent, and the user selected string is coming back as null no matter what I select in the textbox. dsource=new
    Message 1 of 2 , May 30, 2007
    • 0 Attachment
      I'm trying to use the unmatchedItemSelectEvent, and the user selected string is coming
      back as null no matter what I select in the textbox.

      dsource=new YAHOO.widget.DS_JSArray(MY_DATA_ARRAY);
      var ac = new YAHOO.widget.AutoComplete(TEXTBOX_ID,AC_ID,dsource);
      ac.queryDelay = 0;
      ac.minQueryLength = 0;
      ac.itemSelectEvent.subscribe(itemSelectHandler);
      ac.unmatchedItemSelectEvent.subscribe(unmatchedHandler);

      function unmatchedHandler(type,args) {
      alert(args[1]);
      }

      function itemSelectHandler {
      ...
      }

      Whenever the unmatchedHandler event is triggered, args[1] is null instead of the string
      entered. This behavior occurs in Safari & Firefox, so I doubt it's a browser thing. What am I
      doing wrong?

      Thanks
    • spitzzev
      Same behavior in IE6 (on WinXP SP2). ... selected string is coming ... instead of the string ... browser thing. What am I
      Message 2 of 2 , Jul 5 1:08 AM
      • 0 Attachment
        Same behavior in IE6 (on WinXP SP2).

        --- In ydn-javascript@yahoogroups.com, "mwk80569" <orangethreetwo@...>
        wrote:
        >
        > I'm trying to use the unmatchedItemSelectEvent, and the user
        selected string is coming
        > back as null no matter what I select in the textbox.
        >
        > dsource=new YAHOO.widget.DS_JSArray(MY_DATA_ARRAY);
        > var ac = new YAHOO.widget.AutoComplete(TEXTBOX_ID,AC_ID,dsource);
        > ac.queryDelay = 0;
        > ac.minQueryLength = 0;
        > ac.itemSelectEvent.subscribe(itemSelectHandler);
        > ac.unmatchedItemSelectEvent.subscribe(unmatchedHandler);
        >
        > function unmatchedHandler(type,args) {
        > alert(args[1]);
        > }
        >
        > function itemSelectHandler {
        > ...
        > }
        >
        > Whenever the unmatchedHandler event is triggered, args[1] is null
        instead of the string
        > entered. This behavior occurs in Safari & Firefox, so I doubt it's a
        browser thing. What am I
        > doing wrong?
        >
        > Thanks
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.