Skip to content

Commit

Permalink
Fix JS bugs w/validateForm
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronlifshin committed Jun 9, 2014
1 parent 5d47fc8 commit 4159e71
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion assets/pledge.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,21 @@ var PledgeController = ['$scope', '$http', function($scope, $http) {

if (!occ) {
$scope.ctrl.error = "Please enter occupation";
return false;
} else if (!emp) {
$scope.ctrl.error = "Please enter employer";
return false;
} else if (!email) {
$scope.ctrl.error = "Please enter email";
return false;
} else if (!validateEmail(email)) {
$scope.ctrl.error = "Please enter a valid email";
return false;
}
return true;
},
pledge: function() {
if ($scope.ctrl.validateForm($scope.ctrl.form)) {
if ($scope.ctrl.validateForm()) {
var cents = $scope.ctrl.cents();
$scope.ctrl.stripeHandler.open({
email: $scope.ctrl.form.email,
Expand Down

0 comments on commit 4159e71

Please sign in to comment.