diff --git a/site/css/agency.css b/site/css/agency.css
index 1fd6830..8acf1e4 100755
--- a/site/css/agency.css
+++ b/site/css/agency.css
@@ -428,7 +428,13 @@ section#contact .section-heading {
}
section#contact .form-group {
- margin-bottom: 25px;
+ /* margin-bottom: 25px; */
+ margin-bottom: 0px;
+}
+
+section#contact .form-group label {
+ color: white;
+ text-transform: uppercase;
}
section#contact .form-group input,
diff --git a/site/js/contact-form.js b/site/js/contact-form.js
index 1e7a18a..eda041c 100755
--- a/site/js/contact-form.js
+++ b/site/js/contact-form.js
@@ -1,57 +1,59 @@
function submitToAPI(e) {
- e.preventDefault();
- var URL = "https://glfy96rnq4.execute-api.us-east-1.amazonaws.com/contact-form-production-api-stage/oke-engineering-contact-form-api-resource";
+ e.preventDefault();
+ var URL = "https://0c9hzp8v6g.execute-api.us-east-1.amazonaws.com/default/oke-engineering-contact-form-file-attachment";
- var Namere = /[A-Za-z]{1}[A-Za-z]/;
- if (!Namere.test($("#name-input").val())) {
- alert ("Name can not less than 2 char");
- return;
- }
- var mobilere = /[0-9]{10}/;
- if (!mobilere.test($("#phone-input").val())) {
- alert ("Please enter valid mobile number");
- return;
- }
- if ($("#email-input").val()=="") {
- alert ("Please enter your email id");
- return;
- }
+ var Namere = /[A-Za-z]{1}[A-Za-z]/;
+ if (!Namere.test($("#name-input").val())) {
+ alert ("Name can not less than 2 char");
+ return;
+ }
+ var mobilere = /[0-9]{10}/;
+ if (!mobilere.test($("#phone-input").val())) {
+ alert ("Please enter valid mobile number");
+ return;
+ }
+ if ($("#email-input").val()=="") {
+ alert ("Please enter your email id");
+ return;
+ }
- var reeamil = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,6})?$/;
- if (!reeamil.test($("#email-input").val())) {
- alert ("Please enter valid email address");
- return;
- }
+ var reeamil = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,6})?$/;
+ if (!reeamil.test($("#email-input").val())) {
+ alert ("Please enter valid email address");
+ return;
+ }
- var name = $("#name-input").val();
- var phone = $("#phone-input").val();
- var email = $("#email-input").val();
- var desc = $("#description-input").val();
- var data = {
- name : name,
- phone : phone,
- email : email,
- desc : desc
- };
+ var name = $("#name-input").val();
+ var phone = $("#phone-input").val();
+ var email = $("#email-input").val();
+ var desc = $("#description-input").val();
+ var file = $("#file-input").val();
+ var data = {
+ name : name,
+ phone : phone,
+ email : email,
+ desc : desc,
+ file : file
+ };
- $.ajax({
- type: "POST",
- url : "https://glfy96rnq4.execute-api.us-east-1.amazonaws.com/contact-form-production-api-stage/oke-engineering-contact-form-api-resource",
- dataType: "json",
- crossDomain: "true",
- contentType: "application/json; charset=utf-8", 'Access-Control-Allow-Origin': '*',
- data: JSON.stringify(data),
+ $.ajax({
+ type: "POST",
+ url : URL,
+ dataType: "json",
+ crossDomain: "true",
+ contentType: "application/json; charset=utf-8", 'Access-Control-Allow-Origin': '*',
+ data: JSON.stringify(data),
- success: function () {
+ success: function () {
// clear form and show a success message
alert("Successfull");
- document.getElementById("contact-form").reset();
- location.reload();
- },
- error: function () {
- // show an error message
- alert("UnSuccessfull");
- }
- });
+ document.getElementById("contact-form").reset();
+ location.reload();
+ },
+ error: function () {
+ // show an error message
+ alert("UnSuccessfull");
+ }
+ });
}
diff --git a/site/js/contact_me.js b/site/js/contact_me.js
deleted file mode 100755
index 6e91590..0000000
--- a/site/js/contact_me.js
+++ /dev/null
@@ -1,75 +0,0 @@
-$(function() {
-
- $("#contactForm input,#contactForm textarea").jqBootstrapValidation({
- preventSubmit: true,
- submitError: function($form, event, errors) {
- // additional error messages or events
- },
- submitSuccess: function($form, event) {
- event.preventDefault(); // prevent default submit behaviour
- // get values from FORM
- var name = $("input#name").val();
- var email = $("input#email").val();
- var phone = $("input#phone").val();
- var message = $("textarea#message").val();
- var firstName = name; // For Success/Failure Message
- // Check for white space in name for Success/Fail message
- if (firstName.indexOf(' ') >= 0) {
- firstName = name.split(' ').slice(0, -1).join(' ');
- }
- $this = $("#sendMessageButton");
- $this.prop("disabled", true); // Disable submit button until AJAX call is complete to prevent duplicate messages
- $.ajax({
- url: "././mail/contact_me.php",
- type: "POST",
- data: {
- name: name,
- phone: phone,
- email: email,
- message: message
- },
- cache: false,
- success: function() {
- // Success message
- $('#success').html("
");
- $('#success > .alert-success').html("");
- $('#success > .alert-success')
- .append("Your message has been sent. ");
- $('#success > .alert-success')
- .append('
');
- //clear all fields
- $('#contactForm').trigger("reset");
- },
- error: function() {
- // Fail message
- $('#success').html("
");
- $('#success > .alert-danger').html("");
- $('#success > .alert-danger').append($("").text("Sorry " + firstName + ", it seems that my mail server is not responding. Please try again later!"));
- $('#success > .alert-danger').append('
');
- //clear all fields
- $('#contactForm').trigger("reset");
- },
- complete: function() {
- setTimeout(function() {
- $this.prop("disabled", false); // Re-enable submit button when AJAX call is complete
- }, 1000);
- }
- });
- },
- filter: function() {
- return $(this).is(":visible");
- },
- });
-
- $("a[data-toggle=\"tab\"]").click(function(e) {
- e.preventDefault();
- $(this).tab("show");
- });
-});
-
-/*When clicking on Full hide fail/success boxes */
-$('#name').focus(function() {
- $('#success').html('');
-});