1

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

3 Answers 3

2
<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
Sign up to request clarification or add additional context in comments.

Comments

1

It is simplest one task using angularjs. Check the fiddle link.

LINK:

FIDDLE

answered Oct 6, 2015 at 11:42

Comments

0

In controller watch dept_short_name and change loginname as you want inside watch.

answered Oct 6, 2015 at 11:43

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.