valueTemplate

A template string or a function used for formatting the value of the input element that the AutoComplete is initialized from.

Using the valueTemplate setting, one can specify what exactly is shown in the input whenever an item from the auto complete widget is selected.

A live demo and code examples of this functionality can be found here.


<input id="autocomplete"></input>

<script type="text/javascript">

     $(function () {
       $("#autocomplete").shieldAutoComplete({
            dataSource: {
                data: myData
            },
            textTemplate: "{name}",
            valueTemplate: "{id}",
        });
    });

</script>