I've got a couple of fields with autocomplete running on them and populating hidden fields - but on the third field, which is just a cut and paste of the second it doesn't even fire. For the first two I can "inspect" and look at the network tab and see my keystrokes being translated into ajax requests. The third - nothing happens, nothing in network, nothing in console. Any ideas? <script type='text/javascript'> $(function() { $("#RegistrationTradingname").autocomplete({ source: "/registrations/getTradingName", minLength: 2, select: function( event, ui ) { if (ui.item){ $('#RegistrationMembershipId').val(ui.item.id); console.log(ui.item.value); console.log(ui.item.id); } } }); $("#RegistrationName1").autocomplete({ minLength: 2, cacheLength: 0, source: function( request, response ) { $.ajax({ url: "/registrations/getMemberName/", dataType: "json", data: { membership_id: $('#RegistrationMembershipId').val(), term: request.term }, success: function(data) { response(data); } }); }, select: function( event, ui ) { if (ui.item){ var res = ui.item.value.split("|"); $('#RegistrationFirstname').val(res[0]); $('#RegistrationName').val(res[1]); ui.item.value = res[0]+' '+res[1]; } } }); $("#RegistrationName2").autocomplete({ minLength: 2, cacheLength: 0, source: function( request, response ) { $.ajax({ url: "/registrations/getMemberName/", dataType: "json", data: { membership_id: $('#RegistrationMembershipId').val(), term: request.term }, success: function(data) { response(data); } }); }, select: function( event, ui ) { if (ui.item){ var res = ui.item.value.split("|"); $('#RegistrationFirstname2').val(res[0]); $('#RegistrationName2').val(res[1]); ui.item.value = res[0]+' '+res[1]; } } }); }); </script> HTML:
Maybe a stupid question, but are there any typos in the field names/IDs for the third field in your HTML? The number of times I have copied and pasted HTML then either not amended a name/ID or made a typo...
Ryan - you were right on the money and I didn't see it staring me in the face! Realised that my hidden field and my display name had the same id, didn't happen to the first because the display name had a 1 while the hidden fields didn't.