Solved

Form Validation using AngularJS

Posted on 2014-09-15
2
377 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
2 Comments
 
LVL 25

Accepted Solution

by:
Kyle Hamilton earned 500 total points
Comment Utility
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
Comment Utility
Thank you
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

771 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now