I'm not entirely sure what's going on here, but I am trying to add in the author names (or au_fname) from an author. I want to use the author's name in an autocomplete search. So far this is what I have.
<script type="text/javascript" language="javascript">
$(function () {
var model = @Html.Raw(Json.Serialize(Model));
var stra = [];
model.forEach(function (element) {
stra.push(element.au_fname);
});
$("#id").autocomplete({
source: stra
});
});
</script>
I'm not sure how I am supposed to link the element to be able to access au_fname. Any help would be much appreciated.