1

When user enters any value in one textbox the same value should get populated in another texbox, i tried below one but not working.Please suggest.

<title></title>
<script src="Scripts/angular.min.js"></script>
<script type="text/javascript">
var app = angular.module('myApp', []);
app.controller('myCntrl', function ($scope) {
    $scope.txt1 = "AngularDemo";
});
</script>
<body>
    <form id="form1" runat="server" ng-app="myApp">
        <div data-ng-controller="myCntrl">
            <asp:TextBox ID="TextBox1" runat="server" ng-model="txt1"></asp:TextBox>
            <asp:TextBox ID="TextBox2" runat="server" ng-bind="txt1" Text="{{txt1}}" style="border-color:{{txt1}}"></asp:TextBox>                        
        </div>
    </form>
</body>
</html>

1 Answer 1

1

Just use ng-model everywhere

<form id="form1" runat="server" ng-app="myApp">
    <div data-ng-controller="myCntrl">
        <asp:TextBox ID="TextBox1" runat="server" ng-model="txt1"></asp:TextBox>
        <asp:TextBox ID="TextBox2" runat="server" ng-model="txt1" style="border-color:{{txt1}}"></asp:TextBox>                        
    </div>
</form>

What did you try to achieve with the following : Text="{{txt1}}"

Sign up to request clarification or add additional context in comments.

1 Comment

I need to reflect all textbox value on pop-up form textbox.

Your Answer

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.