mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-12-29 05:21:01 +00:00
Added validate on email
This commit is contained in:
@@ -6,7 +6,7 @@
|
|||||||
<h4>Want to contact us?</h4>
|
<h4>Want to contact us?</h4>
|
||||||
<div id="contact-container">
|
<div id="contact-container">
|
||||||
<form id="contact-form" method="post" onsubmit="return false;">
|
<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">
|
<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>
|
<button class="contact-button-submit" action="submit" id="submit-contact-form">Send</button>
|
||||||
<div class="valign hide" id="send-loader">
|
<div class="valign hide" id="send-loader">
|
||||||
|
|||||||
2
static/dist/embed.min.js
vendored
2
static/dist/embed.min.js
vendored
File diff suppressed because one or more lines are too long
2
static/dist/frontpage.min.js
vendored
2
static/dist/frontpage.min.js
vendored
File diff suppressed because one or more lines are too long
2
static/dist/main.min.js
vendored
2
static/dist/main.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -170,20 +170,22 @@ var Helper = {
|
|||||||
|
|
||||||
send_mail: function(from, message){
|
send_mail: function(from, message){
|
||||||
|
|
||||||
$.ajax({
|
if(from != "" && message != ""){
|
||||||
type: "POST",
|
$.ajax({
|
||||||
data: {from: from, message: message},
|
type: "POST",
|
||||||
url: "/php/mail.php",
|
data: {from: from, message: message},
|
||||||
success: function(data){
|
url: "/php/mail.php",
|
||||||
if(data == "success"){
|
success: function(data){
|
||||||
$("#contact-container").empty();
|
if(data == "success"){
|
||||||
$("#contact-container").html("Mail has been sent, we'll be back with you shortly.")
|
$("#contact-container").empty();
|
||||||
}else{
|
$("#contact-container").html("Mail has been sent, we'll be back with you shortly.")
|
||||||
$("#contact-container").empty();
|
}else{
|
||||||
$("#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>")
|
$("#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>")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user