-
Notifications
You must be signed in to change notification settings - Fork 0
/
contact.js
64 lines (59 loc) · 1.32 KB
/
contact.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*
$( document ).ready(function() {
$('#submitFeedback').click(function(){
if (formIsFilled()&& validateemail())
{
alert("Thanks for your feedback!");
window.location.reload();
return true;
}
else
{
return false;
}
});
function formIsFilled(){
if($('#fullname').val()!="" && $('#email').val()!="" )
{
$("#warning1").text("");
return true;
}
else
{
$("#warning1").text("Name and email ID are required");
return false;
}
}
function validateemail(){
var emailVar=$("#email").val();
var emailRegExp = /^[a-zA-Z0-9_.]+@[A-Za-z0-9.-]+\.[a-zA-Z]{2,3}$/;
if(emailRegExp.test(emailVar))
{
$("#emailSpan").text("");
return true;
}
else
{
$("#emailSpan").text("Enter a valid Email ID");
return false;
}
}
$('#email').blur(function(){
validateemail();
});
});
*/
var app = angular.module('myApp', []);
app.controller('validateCtrl', function($scope) {
$scope.user = '';
$scope.email = '';
$scope.submitForm = function() {
// check to make sure the form is completely valid
if ($scope.myForm.$valid) {
alert('Thanks for your feedback!');
$scope.user = '';
$scope.email = '';
$scope.myForm.$setPristine();
}
};
});