I believe that you are interested in updating other HTML elements on the page when the user selects something from an autocomplete text box - is that right?
You may already have the above code to provide autocompletion of "offers" by user type. If I understand correctly, you want to update several fields after the user accepts one of the offers.
To do this, use the select parameter for autocomplete options.
$("#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 }; })); } }); }, select: function (event, ui) { var v = ui.item.value; $('#MessageTo').html("Something here" + v); $('#Hidden1').html("Something else here" + v);
Also: your use of ASMX does not matter. In terms of autocompletion, it's just a data source. In addition, the use of POST does not matter. You can configure ASMX on the server side to enable HTTP GET. This is not a security hole if you turned it on. This is just another way to accept requests.
The autocomplete block cannot determine if the server side is ASMX or Python, or ASP-classic, or PHP, or something else. If I understand the question correctly, your comment, which I see in some similar posts, but not in combination with ASMX, does not matter.
Cheeso
source share