> > missing ( before formal parameters > > $("#postcode").change(function{$("#town").val(zipToCityHash.$("#postcode").val()... >
Also, I see what you're trying to do there, but you can't access object properties like that. You probably want something like: $("#postcode").change(function() { $("#town").val(zipToCityHash[$("#postcode").val()]); }); Plus, you don't need to select #postcode again. You can access it with 'this' in the event handler: $("#postcode").change(function() { $("#town").val(zipToCityHash[this.value]); }); And, if the user enters a zip that isn't in your hash, val() will get passed undefined, which does the same thing as calling val() with no arguments: it returns the current value without changing it. So if you want to change or clear town if the user enters a zip that isn't in your hash, you could do something like: $("#postcode").change(function() { if(zipToCityHash[this.value]) { $("#town").val(zipToCityHash[this.value]); } else { $("#town").val(""); // clear town, or whatever you want to do in this case } }); Hope it helps. --Erik