blob: 4132e8a66b61078d1a6fec530d3e4ca5d3b2b162 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
// Contact form validation
$( document ).ready(function() {
$.validate({
modules : 'html5, toggleDisabled'
});
});
// Async contact form
$('form[id=contactForm]').submit(function(){
$.post($(this).attr('action'), $(this).serialize(), function(res){
$('form[id=contactForm] #success').hide();
$('form[id=contactForm] #error').hide();
if (res.code == "200")
$('form[id=contactForm] #success').show();
}).fail(function(){
$('form[id=contactForm] #success').hide();
$('form[id=contactForm] #error').hide();
$('form[id=contactForm] #error').show();
});
return false;
});
// Callback function for captcha
function onSubmit(token) {
$('form[id=contactForm]').submit();
}
|