summaryrefslogtreecommitdiffstats
path: root/webroot/js/jquery.form.js
diff options
context:
space:
mode:
authorMichael Francis <edude03@gmail.com>2011-05-28 13:28:16 -0400
committerMichael Francis <edude03@gmail.com>2011-05-28 13:28:16 -0400
commit2389d66da849798f8d4ec5f10e3b07c11da49185 (patch)
treee22556d12982395b469a23420c662662e3e064cc /webroot/js/jquery.form.js
downloadotakuhub-2389d66da849798f8d4ec5f10e3b07c11da49185.tar.xz
Initial Commit
Diffstat (limited to 'webroot/js/jquery.form.js')
-rwxr-xr-xwebroot/js/jquery.form.js37
1 files changed, 37 insertions, 0 deletions
diff --git a/webroot/js/jquery.form.js b/webroot/js/jquery.form.js
new file mode 100755
index 0000000..e9d5df5
--- /dev/null
+++ b/webroot/js/jquery.form.js
@@ -0,0 +1,37 @@
+jQuery(document).ready(function(){
+
+ $('#contactform').submit(function(){
+
+ var action = $(this).attr('action');
+
+ $("#message").slideUp(750,function() {
+ $('#message').hide();
+
+ $('#submit')
+ .after('<img src="./img/form/ajax-loader.gif" class="loader" />')
+ .attr('disabled','disabled');
+
+ $.post(action, {
+ name: $('#name').val(),
+ email: $('#email').val(),
+ subject: $('#subject').val(),
+ comments: $('#comments').val(),
+ verify: $('#verify').val()
+ },
+ function(data){
+ document.getElementById('message').innerHTML = data;
+ $('#message').slideDown('slow');
+ $('#contactform img.loader').fadeOut('slow',function(){$(this).remove()});
+ $('#contactform #submit').attr('disabled','');
+ if(data.match('success') != null) $('#contactform').slideUp('slow');
+
+ }
+ );
+
+ });
+
+ return false;
+
+ });
+
+}); \ No newline at end of file