From 2389d66da849798f8d4ec5f10e3b07c11da49185 Mon Sep 17 00:00:00 2001 From: Michael Francis Date: Sat, 28 May 2011 13:28:16 -0400 Subject: Initial Commit --- webroot/js/jquery.form.js | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100755 webroot/js/jquery.form.js (limited to 'webroot/js/jquery.form.js') 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('') + .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 -- cgit v1.2.3