1var csrflistHash = $('#csrflistHash').val(); 2 3 4app.controller('contactServicesCtrl', function ($scope, $http, toastr) { 5 $scope.contactServicesCtrlInit = function () { 6 7 $scope.firstName = ''; 8 $scope.email = ''; 9 $scope.subject = ''; 10 $scope.message = ''; 11 12 } 13 $scope.createHtmlErrorDiv = function (message) { 14 return '<div id="name" ><h4 style="color: red; font-size: small">' + message + '</h4></div>' 15 } 16 $scope.formSubmitButton = function () { 17 // alert('hellos'); 18 if ($scope.firstName) { 19 if (($scope.firstName.match(/^[a-zA-z\s][a-zA-Z ._-\s]+$/))) { 20 if (($scope.email)) { 21 if (($scope.subject)) { 22 checkIsValidForm(); 23 var transform = function (data) { 24 return $.param(data); 25 26 } 27 $http.post(window.site_url + 'Website/sendContactForm', { 28 name: $scope.firstName, 29 email: $scope.email, 30 subject: $scope.subject, 31 message: $scope.message, 32 }, { 33 headers: { 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8' }, 34 transformRequest: transform 35 }).then(function (response) { 36 37 if (response.data.status.status == "0") { 38 toastr.success(response.data.status.message); 39 $scope.contactServicesCtrlInit(); 40 grecaptcha.reset(); 41 } else { 42 toastr.error(response.data.status.message); 43 } 44 }) 45 46 47 48 49 } else { 50 document.getElementById("subject").focus(); 51 var getFirstNameParent = $("#subject").parent(); 52 getFirstNameParent.append($scope.createHtmlErrorDiv("Please enter Subject")) 53 } 54 } else { 55 document.getElementById("email").focus(); 56 var getFirstNameParent = $("#email").parent(); 57 getFirstNameParent.append($scope.createHtmlErrorDiv("Please enter Email address")) 58 } 59 } else { 60 document.getElementById("firstName").focus(); 61 var getFirstNameParent = $("#firstName").parent(); 62 getFirstNameParent.append($scope.createHtmlErrorDiv("Please enter valid name")) 63 } 64 } else { 65 document.getElementById("firstName").focus(); 66 var getFirstNameParent = $("#firstName").parent(); 67 getFirstNameParent.append($scope.createHtmlErrorDiv("Please enter First name")) 68 } 69 } 70}); 71 72function checkIsValidForm() { 73 var response = grecaptcha.getResponse(); 74 75 if (response.length == 0) { 76 alert("Captch is required"); 77 return false 78 } 79}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.