Reputation: 3560
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.
Upvotes: 1
Views: 55
Reputation: 1036
In controller watch dept_short_name
and change loginname
as you want inside watch.
Upvotes: 0
Reputation: 12093
It is simplest one task using angularjs.
Check the fiddle link.
LINK:
Upvotes: 1
Reputation: 22496
<input type="text" ng-model="dept_short_name" />
<input type="text" readonly="readonly" ng-model="dept_short_name"></input>
Upvotes: 2