title: jQuery UI autocomplete update hidden field with value but display label in UI, in conjunction with ASMX
body: <p>In the snippet below, how can I get the jquery autocomplete plugin to:</p>
  
  <ol>
  <li>Update a hidden field with the UserID</li>
  <li>Update '#MessageTo' with the full name</li>
  </ol>
  
  <p>I believe I need to use .result, but I can't figure out the syntax.  Please note that I'm using ASMX so I must do a post (don't want to enable security risk)</p>
  
  <pre><code>    $("#MessageTo").autocomplete({
          dataType: "json",
          autoFocus: true,
          minLength: 3,
          source: function (request, response) {
              var postParams = "{ pattern: '" + $("#MessageTo").val() + "' }";
  
              return jQuery_1_7_1.ajax({
                  type: "POST",
                  contentType: "application/json; charset=utf-8",
                  url: '/Services/Users.asmx/GetNames',
                  data: postParams,
                  dataType: "json",
                  success: function (data) {
                      response($.map(data.d.Users, function (c) {
                          return {
                              label: c.FullName,
                              value: c.UserID
                          };
                      }));
                  }
              });
          }
      });
  </code></pre>
  
  <p>I see some similar posts but not in conjunction with ASMX.</p>