Added validate on email

This commit is contained in:
Kasper Rynning-Tønnesen
2016-02-09 08:12:10 +01:00
parent 67e1f47fab
commit 1971783bbd
5 changed files with 19 additions and 17 deletions
+1 -1
View File
@@ -6,7 +6,7 @@
<h4>Want to contact us?</h4>
<div id="contact-container">
<form id="contact-form" method="post" onsubmit="return false;">
<input id="contact-form-from" name="from" type="email" placeholder="your@mail.com" autocomplete="off">
<input id="contact-form-from" name="from" type="email" placeholder="your@mail.com" autocomplete="off" class="validate">
<input id="contact-form-message" name="message" type="text" placeholder="Your message to us..." autocomplete="off">
<button class="contact-button-submit" action="submit" id="submit-contact-form">Send</button>
<div class="valign hide" id="send-loader">
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+15 -13
View File
@@ -170,20 +170,22 @@ var Helper = {
send_mail: function(from, message){
$.ajax({
type: "POST",
data: {from: from, message: message},
url: "/php/mail.php",
success: function(data){
if(data == "success"){
$("#contact-container").empty();
$("#contact-container").html("Mail has been sent, we'll be back with you shortly.")
}else{
$("#contact-container").empty();
$("#contact-container").html("Something went wrong, sorry about that. You could instead try with your own mail-client: <a title='Open in client' href='mailto:contact@zoff.no?Subject=Contact%20Zoff'>contact@zoff.no</a>")
if(from != "" && message != ""){
$.ajax({
type: "POST",
data: {from: from, message: message},
url: "/php/mail.php",
success: function(data){
if(data == "success"){
$("#contact-container").empty();
$("#contact-container").html("Mail has been sent, we'll be back with you shortly.")
}else{
$("#contact-container").empty();
$("#contact-container").html("Something went wrong, sorry about that. You could instead try with your own mail-client: <a title='Open in client' href='mailto:contact@zoff.no?Subject=Contact%20Zoff'>contact@zoff.no</a>")
}
}
}
});
});
}
}
}