Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Form Validation using AngularJS

Posted on 2014-09-15
2
Medium Priority
?
401 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 1500 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
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…

719 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