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

pass "hidden" value for autocomplete widget

Expand Messages
  • functionform
    Hey all, My XML is being fed to the AC component, and one of the tags corresponds to an id field that I want to secretly pass back to the form. The user will
    Message 1 of 2 , Sep 30, 2006
      Hey all,

      My XML is being fed to the AC component, and one of the tags
      corresponds to an id field that I want to secretly pass back to the
      form.

      The user will select
      "Edward James Olmos"
      but the form should also pass "celebrity_id=1337" etc.

      I didn't see anything explicity allowing for this by configuration,
      and I'm not sure how to get it working... it looks like
      itemSelectEvent is the way to go but I'm not clear on the data model a
      it passes back to the subscriber..

      Any one have an example working?
    • jennykhan
      Hi functionform, You should try something like this: myAutoComp.itemSelectEvent.subscribe(myHandler); var myHandler = function(myAutoComp, listItem, dataArray)
      Message 2 of 2 , Nov 9, 2006
        Hi functionform,

        You should try something like this:

        myAutoComp.itemSelectEvent.subscribe(myHandler);

        var myHandler = function(myAutoComp, listItem, dataArray) {
        var id = dataArray[n] // depends on where in your schema "id" is
        defined
        document.getElementById("hiddenField").value = id;
        };

        Hope that helps,
        jenny




        --- In ydn-javascript@yahoogroups.com, "functionform"
        <functionform@...> wrote:
        >
        > Hey all,
        >
        > My XML is being fed to the AC component, and one of the tags
        > corresponds to an id field that I want to secretly pass back to the
        > form.
        >
        > The user will select
        > "Edward James Olmos"
        > but the form should also pass "celebrity_id=1337" etc.
        >
        > I didn't see anything explicity allowing for this by configuration,
        > and I'm not sure how to get it working... it looks like
        > itemSelectEvent is the way to go but I'm not clear on the data model a
        > it passes back to the subscriber..
        >
        > Any one have an example working?
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.