This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function (info) { | |
//private variable | |
var values = {}; | |
for(var prop in info) { | |
if(values[prop] !== 'undefined') { | |
values[prop] = info[prop]; | |
} | |
} | |
//return public function | |
return { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once('class.phpmailer.php'); | |
$errors = array(); // array to hold validation errors | |
$data = array(); // array to pass back data | |
// validate the variables ====================================================== | |
if (empty($_POST['name'])) | |
$errors['name'] = 'Name is required.'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// define angular module/app | |
var formApp = angular.module('formApp', []); | |
// create angular controller and pass in $scope and $http | |
function formController($scope, $http) { | |
// create a blank object to hold our form information | |
// $scope will allow this to pass between controller and view | |
$scope.formData = {}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src = "scripts/form.js"></script> | |
<div class="container" ng-app="formApp" ng-controller="formController"> | |
<div class="col-md-6 col-md-offset-3"> | |
<!-- PAGE TITLE --> | |
<div class="page-header"> | |
<h1><span class="glyphicon glyphicon-tower" style="font-size:20px"></span><span style="font-size:20px; margin-left:10px;">Send a direct e-mail to us</span></h1> | |
</div> | |
<!-- SHOW ERROR/SUCCESS MESSAGES --> | |
<div id="messages" class="well" ng-show="message"></div> | |
<!-- FORM --> |
NewerOlder