I have two input filed and those are given below.
<input type="text" name="itemname" id="contactno" class="form-control" placeholder="short name" ng-model="dept_short_name" >
<input type="text" name="itemname" id="contactno" class="form-control" ng-model="loginname" readonly="readonly" value="{{dept_short_name}}" >
I need when user will type any text in first input field the second input field will update with same data simultaneously.Please help me.
asked Oct 6, 2015 at 11:33
satya
3,58011 gold badges59 silver badges136 bronze badges
3 Answers 3
<input type="text" ng-model="dept_short_name" />
<input type="text" readonly="readonly" ng-model="dept_short_name"></input>
answered Oct 6, 2015 at 11:38
Evgeni Dimitrov
22.6k34 gold badges124 silver badges148 bronze badges
Sign up to request clarification or add additional context in comments.
Comments
answered Oct 6, 2015 at 11:42
Ved
12.1k5 gold badges46 silver badges61 bronze badges
Comments
In controller watch dept_short_name and change loginname as you want inside watch.
answered Oct 6, 2015 at 11:43
xxlali
1,0662 gold badges17 silver badges50 bronze badges
Comments
lang-js