Permalink
Browse files

more form shit

  • Loading branch information...
warends committed Oct 12, 2017
1 parent b92b091 commit 048fb628c3a0b37807cc74daa6cf8bc68b7390e9
@@ -7,7 +7,7 @@ angular.module('common.nav', []).controller('NavController', ['$scope', '$rootSc
.then(function(message, status, headers, config){
$rootScope.toggleContact();
console.log(message);
notifier.notify('Thank you for your message ' + message.name);
notifier.notify('Thank you for your message ' + message.data.name);
$scope.formData = {};
}, function(error, status, headers, config){
console.log(error);
@@ -32,7 +32,7 @@ angular.module('ed.controller', []).controller('EDesignController', ['$scope', '
var box = angular.element(e.target);
}
var qForm = document.getElementById('qFormTitle');
const qForm = document.getElementById('qFormTitle');
$scope.questions = QFactory.list();
$scope.currentQuestion = 0;
@@ -42,7 +42,6 @@ angular.module('ed.controller', []).controller('EDesignController', ['$scope', '
$scope.nextQ = () => {
qForm.scrollIntoView(true);
console.log('scrolled');
$scope.currentQuestion = ($scope.currentQuestion < $scope.questions.length -1) ? ++$scope.currentQuestion : 0;
}
@@ -68,10 +67,15 @@ angular.module('ed.controller', []).controller('EDesignController', ['$scope', '
$http.post('/questionaire-form', data)
.then((response) => {
console.log(response.data);
$scope.currentQuestion = 0;
$rootScope.qShow = false;
notifier.notify('Thank you for your message ' + response.data.name);
$scope.qForm.$setPristine();
$scope.colorList = [];
$scope.colorNoList = [];
$scope.drawnToList = [];
$scope.furnitureList = [];
$scope.formData= {};
}, (err) => {
notifier.error('There was an error processing your request. Please try again');
console.log('There was a problem submitting your form ' + err);
@@ -7,7 +7,6 @@
<div class="row" ng-class="question.id" ng-show="question.type == 'radio'">
<div class="col-xs-12 col-sm-8 col-sm-offset-2">
<div ng-repeat="answer in question.answers" class="q-radio">
<div class="clearfix" ng-if="$index % 3 == 0 && screenW >= 768"></div>
<div class="radio" ng-class="question.cols">
<label>
@@ -17,7 +16,6 @@
</label>
</div>
</div>
<!-- <span>{{question.response}}</span> -->
</div>
</div><!--end radios-->
View

Large diffs are not rendered by default.

Oops, something went wrong.

0 comments on commit 048fb62

Please sign in to comment.