Solved

Form Validation using AngularJS

Posted on 2014-09-15
2
383 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
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Detect which div element is visible? ***Javascript Only solution*** 4 22
Button function on table is in trouble 3 22
asp Google Map 2 33
Possible propagation problem 1 25
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.
This article discusses four methods for overlaying images in a container on a web 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 style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …

821 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