0

My code is here: http://plnkr.co/edit/2WDK0b

Is it possible that when I enter an existing username, the message in the "help-block" span will change dynamically?

1 Answer 1

1

Just wrap your existing checking code in a function in the controller. Like $scope.checkUsername = function() { //your existing code }

Now on your username input put ng-change="checkUsername()" and then it will work.

Before you get too much further make sure to read the validation bits from the Angular Form's guide: http://docs.angularjs.org/guide/forms

Here's a fiddle of your code working: http://plnkr.co/edit/LwMJGq?p=preview Although I think the logic for the name checking needs a bit of work.

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

Comments

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.