autocomplete with IE7/8 problems
Hi all,
I have implemented the jquery plugin autocomplete perfectly with FF & Safari however with IE 7/8 I seem to be getting problems.
Firstly, here is the error output from IE 7/8:
-
'name' is null or not an object new, line 472 character 9
Here is how I use the autocomplete in my code:
-
<script type="text/javascript">
$(function() {
$('#repeat_content').hide();
var data = [
{ name: "Fred Bloggs", id: "7", type: "Staff" }
];
$("#users").autocomplete(data, {
mustMatch: true,
matchContains: true,
formatItem: function(row, i, max) {
if(row.type == "Group") {
return row.name + " [" + row.type + "] for " + row.team + " [Team]";
} else {
return row.name + " [" + row.type + "]";
}
},
formatMatch: function(row, i, max) {
[b] return row.name + " " + row.id;[/b]
},
formatResult: function(row) {
return row.name;
}
});
...
The error occurs at the bold line of code above:
-
return row.name + " " + row.id;
Can any one shed some light onto why this is occuring with only IE 7/8?
Any help would be much appreciated!
Thanks!