Solved

Form Validation using AngularJS

Posted on 2014-09-15
2
387 Views
Last Modified: 2014-09-20
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
Comment
Question by:ksd123
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 25

Accepted Solution

by:
Kyle Hamilton earned 500 total points
ID: 40323929
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
 

Author Closing Comment

by:ksd123
ID: 40334927
Thank you
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
This article discusses how to implement server side field validation and display customized error messages to the client.
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question