$(document).ready(function(){ var options = { target: '#output1', beforeSubmit: showRequest, success: showResponse }; $('#testform').ajaxForm(options); var left = (window.screen.availWidth-450)/2; $(".panel").animate({opacity: "0"}, 1); $(".panel").css("left",left); $(".panel").animate({opacity: "0.9"}, "slow"); $(".panel #inpanel #closebtn .delete").click(function(){ $(".panel").animate({ opacity: "hide" }, "slow") return false; }); $(".panel #inpanel #snow_test .btn .send").click(function(){ $(".panel").animate({ opacity: "hide" }, "slow"); $('#testform').ajaxSubmit(); return false; }); $('#testform').ajaxForm(function() { alert("Thank you for your comment!"); }); }); function showRequest(formData, jqForm, options) { var queryString = $.param(formData); alert('About to submit: \n\n' + queryString); return true; } function showResponse(responseText, statusText) { alert('status: ' + statusText + '\n\nresponseText: \n' + responseText + '\n\nThe output div should have already been updated with the responseText.'); }