Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hello Guys,

I am troubling with below problem,i Am new in angularjs and MVC also.


I wanted to take Autocomplete textbox for City.

So I have used Datalist to bind that text box. and On Datalist wanted to show list description on UI and at Backend want to save its Code.

So How can I do this. Please suggest me.

Below is my code :
HTML
<table style="width: 100%; align-items: center" border="1"><tbody>
<tr ng-repeat="accounthead in accountheadconfiggrid">
<td> 	accounthead.otheData</td>
<td>
HTML
<input type="text" id="answerInput" data-ng-model="accounthead.CityCode" list="comicstitle" autocomplete="on" ng-autocomplete="accounthead">

HTML
<datalist id="comicstitle">          <option ng-repeat="accounthead in accountheadconfiggrid" value="accounthead.CityCode">{{accounthead.Cityname}}</option>
     </datalist></td></table>
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900