Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 407
  • Last Modified:

Form Validation using AngularJS

Hi Experts,

We are using response web design using Bootstrap and I have 3 tabs with Save button in my application and need to do validation for all the tabs using AngularJS.When user clicks save button I need to highlight the corresponding tab that has invalid data using AngularJS/HTml5/Bootstrap.
I can use built-in directives or custom directives for validating data and am not sure if I have to user AngularJS or Bootstrap to highlight tab that has invalid data ? If possible please provide me some sample code.

Thanks in Advance
0
ksd123
Asked:
ksd123
1 Solution
 
Kyle HamiltonData ScientistCommented:
if you are using angular to validate the data, then you can add an .error-class based on the $invalid boolean.

<form name="myform">
<div ng-class={'error-class' : myform.$invalid}>
</form>

Open in new window

.error-class{
  color:red;
}

Open in new window


But without knowing more about your implementation, it's hard to give you a more specific solution.
0
 
ksd123Author Commented:
Thank you
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now