I have already had great help of this piece of code. I am trying to now update another textbox when a jquery autocomplete option is picked.
I made a couple of changes specifically to display two of the options in the multi dimensional array:
a = $.map(a, function (x) {
return {
label: x.suburb + " - " + x.postCode,
value: x.suburb,
suburbDetails: x
};
The second change however breaks it and I cannot workout what form this line of code needs to be to pick and place the postcode in the #postcode textbox.
I have a Jsfiddle where it works (as an aside css doesnt work either here or in the project select eg "b") when the line is commented out but crashes when its uncommented.
$("#Postcode").val(data.suburbDetails.postCode)
How would you update the postcode textbox with the associated postcode for the suburb given both are/should be accessable via "data.suburbDetails"?