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