mirror of
https://github.com/danog/danog.github.io.git
synced 2024-12-02 09:27:48 +01:00
y
This commit is contained in:
parent
b6662b1de3
commit
e45a2c350f
@ -86,7 +86,7 @@
|
|||||||
|
|
||||||
<!-- Contact Form JavaScript -->
|
<!-- Contact Form JavaScript -->
|
||||||
<script src="js/jqBootstrapValidation.js"></script>
|
<script src="js/jqBootstrapValidation.js"></script>
|
||||||
<script src="js/contact_me.js?v=4"></script>
|
<script src="js/contact_me.js?v=5"></script>
|
||||||
|
|
||||||
<!-- Custom Theme JavaScript -->
|
<!-- Custom Theme JavaScript -->
|
||||||
<script src="js/freelancer.js"></script>
|
<script src="js/freelancer.js"></script>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
$(function() {
|
$(function() {
|
||||||
|
|
||||||
$("input,textarea").jqBootstrapValidation({
|
$("#contactForm input,#contactForm textarea").jqBootstrapValidation({
|
||||||
preventSubmit: true,
|
preventSubmit: true,
|
||||||
submitError: function($form, event, errors) {
|
submitError: function($form, event, errors) {
|
||||||
// additional error messages or events
|
// additional error messages or events
|
||||||
@ -9,7 +9,7 @@ $(function() {
|
|||||||
// Prevent spam click and default submit behaviour
|
// Prevent spam click and default submit behaviour
|
||||||
$("#btnSubmit").attr("disabled", true);
|
$("#btnSubmit").attr("disabled", true);
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
||||||
// get values from FORM
|
// get values from FORM
|
||||||
var name = $("input#name").val();
|
var name = $("input#name").val();
|
||||||
var email = $("input#email").val();
|
var email = $("input#email").val();
|
||||||
@ -30,9 +30,10 @@ $(function() {
|
|||||||
email: email,
|
email: email,
|
||||||
message: message,
|
message: message,
|
||||||
domain: domain
|
domain: domain
|
||||||
|
|
||||||
},
|
},
|
||||||
cache: false,
|
cache: false,
|
||||||
|
success: function(data) {
|
||||||
|
$("#btnSubmit").attr("disabled", false);
|
||||||
if(data == "ok") {
|
if(data == "ok") {
|
||||||
// Success message
|
// Success message
|
||||||
$('#success').html("<div class='alert alert-success'>");
|
$('#success').html("<div class='alert alert-success'>");
|
||||||
@ -56,6 +57,7 @@ $(function() {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
error: function() {
|
error: function() {
|
||||||
|
$("#btnSubmit").attr("disabled", false);
|
||||||
// Fail message
|
// Fail message
|
||||||
$('#success').html("<div class='alert alert-danger'>");
|
$('#success').html("<div class='alert alert-danger'>");
|
||||||
$('#success > .alert-danger').html("<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×")
|
$('#success > .alert-danger').html("<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×")
|
||||||
|
Loading…
Reference in New Issue
Block a user