0

My Page doesn't have Form, i want to validate my controls and show validation messages. I can able to see the validation only with forms. How to do the validation without Forms. Appreciate you assistance.

1

2 Answers 2

2

You can assign your "submit" button to a function with ng-click, then check all your form values there, show error messages where it corresponds, and then let it submit if everything's correct.

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

Comments

0

Two-way data binding supported need of you, you don't need form for this. You can hide or show your notification when your condition provided or another cases.

For example:

<input type="text" ng-model="yourObjectModel">

<div ng-show="yourObjectModel.length < 0" class="alert alert-danger">
   Input must be filled
</div>

<div ng-show="yourObjectModel.length > 15" class="alert alert-warning">
   Your value can't bigger than 15
</div>

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.